05.03.2013, 16:31
Try this if this works. i hope it does
pawn Код:
CMD:crashplayer(playerid, params[])
{
new
pName[24],
str[128],
targetid
;
GetPlayerName(targetid, pName, 24);
//
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, COLOR_RED, "You need to be an admin to use this command!");
if(sscanf( params, "u", targetid))
return SendClientMessage(playerid, COLOR_RED, "Usage: /crashplayer <playerid>");
if( playerid == targetid)
return SendClientMessage(playerid, COLOR_RED, "You can't crash yourself!");
if(targetid == INVALID_PLAYER_ID)
return SendClientMessage(playerid, COLOR_RED, "Player not found.");
format(str, sizeof(str), "You crashed %s", pName);
SendClientMessage(playerid, COLOR_ORANGE, str);
if(IsPlayerConnected(player1) && targetid!= INVALID_PLAYER_ID)
{
GetPlayerPos(player1,X,Y,Z);
new CObject = CreatePlayerObject(targetid,888888889999999,X,Y,Z,0,0,0);
DestroyObject(CObject );
}
return 1;
}