02.09.2009, 18:23
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?
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;
}