04.02.2011, 09:48
Untested, but it should work:
pawn Код:
command(cuff, playerid, params[])
{
new x_nr[4], string[128], giveplayerid;
if(sscanf(params,"su",x_nr,giveplayerid)) return SendClientMessage(playerid, baltakrasa, "Sintakse: /cuff <on/off> <speletaja id/vards>.");
if(giveplayerid != INVALID_PLAYER_ID)
{
if(strcmp(x_nr,"on",true) == 0)
{
TogglePlayerControllable(giveplayerid, 0);
format(string, sizeof(string), "Informacija: %s tevi sasledza rokudzelћos.", GetName(id));
SendClientMessage(giveplayerid, baltakrasa, string);
format(string, sizeof(string), "Informacija: Tu sasledzi %s rokudzelћos.", GetName(playerid));
SendClientMessage(playerid, baltakrasa, string);
}
else if(strcmp(x_nr,"off",true) == 0)
{
TogglePlayerControllable(giveplayerid, 1);
format(string, sizeof(string), "Informacija: %s tevi atbrivoja no rokudzelћiem.", GetName(id));
SendClientMessage(giveplayerid, baltakrasa, string);
format(string, sizeof(string), "Informacija: Tu atbrivoji %s no rokudzelћiem.", GetName(playerid));
SendClientMessage(playerid, baltakrasa, string);
}
} else SendClientMessage(playerid, baltakrasa, "Invalid player");
return 1;
}