01.03.2018, 23:24
Your brackets are all messed up. Make sure your { and } brackets are around the correct code after checking the commands.
Also, don't forget to return 1; inside all of the successful commands so that the script can end right there and doesn't have to continue.
Do this for the rest of the commands.
Also, don't forget to return 1; inside all of the successful commands so that the script can end right there and doesn't have to continue.
PHP код:
public OnPlayerCommandText(playerid, cmdtext[]) // if a player writes a command
{ // callback starts.
//< ... other commands ... >
if (strcmp("/terrorist", cmdtext, true, 10) == 0) //if the command is /terrorist then do this:
{ //bracket starts above code, after check
GivePlayerWeapon(playerid, 35, 10000);
GivePlayerWeapon(playerid, 8, 1);
GivePlayerWeapon(playerid, 30, 10000);
return 1; //command was successful and your script can end here
} //bracket ends after the code, command /terrorist ends here
//< ... other commands ... >
return 0; //search for commands ends, no command found
} //callback ends.