16.07.2010, 22:07
I'd suggest you moving to dcmd to make commands with parameters.
But if you insist:
But if you insist:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new tmp[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp("/cuff", cmd, true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /cuff [playerid]");
if(!IsPlayerConnected(strval(tmp))) return SendClientMessage(playerid,0xFF0000FF,"Player is not connected");
TogglePlayerControllable(strval(tmp),0);
GameTextForPlayer(strval(tmp), "~y~ hand cuffs!",2500,3);
return 1;
}
return 0;
}