How to make 2actions with 1 command? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make 2actions with 1 command? (
/showthread.php?tid=195141)
How to make 2actions with 1 command? -
slobbann - 01.12.2010
Okey, I would need a little bit of help.
I want to use 1 command to enable and disable a function for my server. But I dont remember
how I made it. So thats why Im asking
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Enable", cmdtext, true) == 0)
{
AMAZ[playerid] = 1;
SendClientMessage(playerid,COLOR_GREEN,"Enabled");
return 1;
}
if (strcmp("/Disable", cmdtext, true) == 0)
{
SendClientMessage(playerid,COLOR_GREEN,"Disabled");
AMAZ[playerid] = 0;
return 1;
}
return 0;
}
I want those 2 turn into 1 commands.
So instead of typing /enable and /disable I just want 1 commands like /boom :P
Re: How to make 2actions with 1 command? -
Macluawn - 01.12.2010
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/Boom", cmdtext, true) == 0)
{
if(AMAZ[playerid] == 0) {
AMAZ[playerid] = 1;
SendClientMessage(playerid,COLOR_GREEN,"Enabled");
}
else
{
SendClientMessage(playerid,COLOR_GREEN,"Disabled");
AMAZ[playerid] = 0;
}
return 1;
}
return 0;
}
Re: How to make 2actions with 1 command? -
slobbann - 01.12.2010
ahh, Simple xD
Thanks for the fast response