14.11.2010, 03:26
Well im sure you got dcmd and sscanf
Here u go u must be logged in as admin
Here u go u must be logged in as admin
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(spec,4,cmdtext);
return 0;
}
pawn Код:
dcmd_spec(playerid, params[])
{
new
id;
if (sscanf(params, "u", id)) SendClientMessage(playerid,0xFF0000AA, "USAGE: /spec id");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid,0xFF0000AA, "Player is not found");
else
if(IsPlayerAdmin(playerid))
{
TogglePlayerSpectating(playerid, 1);
}
return 1;
}
NOT TESTED