SA-MP Forums Archive
Help with the /enter cmd - 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: Help with the /enter cmd (/showthread.php?tid=95164)



Help with the /enter cmd - pierhs - 02.09.2009

Can I have 2 different /enter cmds without crashing the first?I mean I have one cmd /enter in my gamemode and when I add a 2nd cmd /enter in the filterscript,the first one doesnt work.Is there anyway to fix this?


Re: Help with the /enter cmd - iMonk3y - 02.09.2009

no, I believe you can't have 2 same commands gamemode.


Re: Help with the /enter cmd - [XST]O_x - 02.09.2009

LOL?!
isnt possible(i think O.o)


Re: Help with the /enter cmd - Correlli - 02.09.2009

No, it isn't possible. But you could have commands like /enter subcmd1, /enter subcmd2.


Re: Help with the /enter cmd - HuRRiCaNe - 02.09.2009

also , in the command , the first time you use the comand /enter you create a new vcariable
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new enter[MAX_PLAYERS];
enter[playerid]=0;
if(strcmp(cmdtext, "/enter", true) == 0) {
 if(enter[playerid]==0)
 {
    SendPlayerFormattedText(playerid,"This is the first time u use the command , use /enter again if u want 2nd usage");
//do your things if the command is the first time used;
enter[playerid]=1;
 return 1;
    }
else if(enter[playerid]==1)
{
    SendPlayerFormattedText(playerid,"This is the Second time u use the command , use /enter again if u want 1rst usage");
//do your things if the command is used 2nd time
enter[playerid]=0;//the 0 is if u want to return to the other command
  return 1;
    }
return 1;
}
return 0;
}