05.03.2013, 15:09
Hello SA-MP Community, Today i just made a ZCMD command, it doesn't work for some reason, when i do /crashplayer it says you are not logged in rcon and that's good because im not logged in,
when i log in it says Usage : /crashplayer <playerid> and that's good
But when i try to crash myself, it says player not found. and when i try other player IDS it says Player not found also? what is the problem! Please help!
The stock CrashClient:
when i log in it says Usage : /crashplayer <playerid> and that's good
But when i try to crash myself, it says player not found. and when i try other player IDS it says Player not found also? what is the problem! Please help!
pawn Код:
CMD:crashplayer(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, COLOR_RED, "You need to be an admin to use this command!");
new targetid;
if(sscanf( params, "u", targetid))
return SendClientMessage(playerid, COLOR_RED, "Usage: /crashplayer <playerid>");
else if( playerid == targetid)
return SendClientMessage(playerid, COLOR_RED, "You can't crash yourself!");
else if(targetid == INVALID_PLAYER_ID)
return SendClientMessage(playerid, COLOR_RED, "Player not found.");
new
pName[24],
str[128];
GetPlayerName(targetid, pName, 24);
format(str, 128, "You crashed %s", pName);
SendClientMessage(playerid, COLOR_ORANGE, str);
CrashClient(targetid);
return 1;
}
pawn Код:
stock CrashClient(playerid)
{
if(!IsPlayerConnected(playerid)) return false;
return GameTextForPlayer(playerid, "~~~~~~~~~~~~~~~~~", 1000, 5);
}