Multiple commands same function - 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: Multiple commands same function (
/showthread.php?tid=112720)
Multiple commands same function -
jamesbond007 - 09.12.2009
how can i make that if i type /race or /drag i will teleport to the same place?
(like having multiple commands for the same thing) how can i make multiple commands have the same function/results?
plz help
Re: Multiple commands same function -
Burridge - 09.12.2009
pawn Код:
if(strcmp(cmd, "/example1", true) == 0)
{
SendClientMessage(playerid, GREEN, "Example command one!");
return 1;
}
pawn Код:
if(strcmp(cmd, "/example2", true) == 0)
{
SendClientMessage(playerid, GREEN, "Example command two!");
return 1;
}
It's that simple.
Re: Multiple commands same function -
Joe Staff - 09.12.2009
or
pawn Код:
if(!strcmp(cmdtext[1],"example1",true) || !strcmp(cmdtext[1],"example1",true))
{
return 1;
}
Re: Multiple commands same function -
Christopher. - 09.12.2009
Lol at the " // Blocks PMs", That could be confusing to a new scripter.
Re: Multiple commands same function -
Burridge - 09.12.2009
Quote:
Originally Posted by Chris - X-Host
Lol at the " // Blocks PMs", That could be confusing to a new scripter.
|
It was an accident, deleted. (It's cause i'm re-doing my block-PM command, i'm tired lawl).
Re: Multiple commands same function -
jamesbond007 - 10.12.2009
Quote:
Originally Posted by Joe Staff
or
pawn Код:
if(!strcmp(cmdtext[1],"example1",true) || !strcmp(cmdtext[1],"example1",true)) { return 1; }
|
thanks