SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/03/2020, 04:49 AM   #1
MrHakle
Little Clucker
 
Join Date: Apr 2018
Posts: 5
Reputation: 0
Default Help Me!!!

Hello, I have two questions. Thanks for your reply: D

1- At the moment that papilla [playerid] == 0 throws a message, example:

Code:
if(papilla[playerid] == 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "{FFFF00}[ERROR]:{FFFFFF} No estás en servicio administrativo {F81414}/adminduty o /adminoffduty{FFFFFF} para usar este comando.");
I want the message not to be copied every time i want to use if (papilla [playerid] == 0) in a command, example:

Code:
zcmd(quitardni, playerid, params[])
    {
        if(papilla[playerid] == 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "{FFFF00}[ERROR]:{FFFFFF} No estás en servicio administrativo {F81414}/adminduty o /adminoffduty{FFFFFF} para usar este comando.");

zcmd(irnegocio, playerid, params[])
	{
	    if(papilla[playerid] == 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "{FFFF00}[ERROR]:{FFFFFF} No estás en servicio administrativo {F81414}/adminduty o /adminoffduty{FFFFFF} para usar este comando.");
2- I want two commands to be the same, for example:

/ hang / h
The commands are different but with the same function, without repeating the function.
MrHakle is offline   Reply With Quote
Old 30/03/2020, 04:55 AM   #2
Nuginity
Big Clucker
 
Nuginity's Avatar
 
Join Date: Feb 2020
Location: Indonesia (Jakarta)
Posts: 61
Reputation: 2
Default Re: Help Me!!!

first, what command processor did you used?

second, sorry i can't understand what you mean in the first question

solution for second question
ZCMD:
PHP Code:
CMD:h(playeridparams[]) return cmd_hang(playeridparams);
CMD:hang(playeridparams[])
{
     
//your code
     
return 1;

__________________
Nusantara Freeroam
Current Stage : ALPHA
-------------------------------------------
We Need an Indonesian's Scripter now!
Nuginity is offline   Reply With Quote
Old 30/03/2020, 05:05 AM   #3
MrHakle
Little Clucker
 
Join Date: Apr 2018
Posts: 5
Reputation: 0
Default Re: Help Me!!!

Thanks for the second point.

*What I want to refer to at the moment of using papilla = 0 at the end I put the return with the message, now the problem that every time I want to use a command papilla = 0 I don't want to put the return and the message, I just want to put the papilla = 0 and in all the commands that this variable outputs only the message, it is a bit messy since this variable is used a lot and changing each message is somewhat long.
MrHakle is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 08:55 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.