{ // Your bracket was missing here and it was poorly indented if (strcmp("/cuff", cmdtext, true, 15) == 0) // This should work now { new tmp[128]; new idx; new giveplayerid; new giveplayer[MAX_PLAYER_NAME]; new sendername[MAX_PLAYER_NAME]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid,0xAA3333AA,"USAGE: /cuff [playerid]"); // giveplayerid = strval(tmp); // The problem here was that is should be ReturnUser(tmp) instead of strval(tmp) giveplayerid = ReturnUser(tmp); if(gTeam[playerid] == TEAM_COP) { if(gTeam[giveplayerid] == TEAM_COP) return SendClientMessage(playerid,0xAA3333AA,"You cannot cuff cops !"); TogglePlayerControllable(giveplayerid,0); GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer)); GetPlayerName(playerid,sendername,sizeof(sendername)); format(tmp,sizeof(tmp),"You have cuffed %s",giveplayer); SendClientMessage(playerid,0x33AA33AA,tmp); format(tmp,sizeof(tmp),"You have been cuffed by %s",sendername); SendClientMessage(giveplayerid,0xAA3333AA,tmp); return 1; } else return SendClientMessage(playerid,COLOR_GREY, "You are not a cop!"); // Added this to return a value if someone isn't a cop }
Originally Posted by clean180ollie
your forgot return 1;
|
Originally Posted by Nee
Tell the error or the gm name!
|
cmd = strtok(blabla);
if (strcmp("/cuff", cmd, true) == 0)
Originally Posted by Jefff
Should be cmd not cmdtext
and on top cmdtext Код:
cmd = strtok(blabla); Код:
if (strcmp("/cuff", cmd, true) == 0) |
cmd = strtok(cmdtext, idx);