dcmd_explode(playerid, params[]) { new id; if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /explode [nick/id]"); if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is not connected!"); new Float:Pos[3]; GetPlayerPos(id, Pos[0], Pos[1], Pos[2]); CreateExplosion(Pos[0], Pos[1], Pos[2], 0, 10.0); return 1; }
dcmd_explode(playerid, params[]) { new string[256]; new id; if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /explode [nick/id]"); if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is not connected!"); new Float:Pos[3]; GetPlayerPos(id, Pos[0], Pos[1], Pos[2]); CreateExplosion(Pos[0], Pos[1], Pos[2], 0, 10.0); format(string, sizeof(string), "Admin: %s has exploded %s", playerid,id); SendClientMessageToAll(COLOR_RED, string); return 1; }
Thanks akis_tze but that gives only like:
Admin 59 EXPLODED 5 (EXAMPLES IDS) ..? |
dcmd_explode(playerid, params[])
{
new string[100];
new player[MAX_PLAYER_NAME], new name[MAX_PLAYER_NAME];
GetPlayerName(player,sizeof(player));
GetPlayerName(name,sizeof(name));
if(sscanf(params, "u", player))
return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /explode [nick]");
if(name == INVALID_PLAYER_ID || !IsPlayerConnected(name))
return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is not connected!");
new Float:Pos[3];
GetPlayerPos(name, Pos[0], Pos[1], Pos[2]);
CreateExplosion(Pos[0], Pos[1], Pos[2], 0, 10.0);
format(string, sizeof(string), "Admin: %s has exploded %s", player,name);
SendClientMessageToAll(COLOR_RED, string);
return 1;
}