Hello, i've have an Problem when an Admin type the Command the ID 0 got automatic exploded self when he type just /explode without an playerid. What is the problem here?
Код:
CMD:explode(playerid,params[])
{
if(pInfo[playerid][pLogged] == 1)
{
if(pInfo[playerid][pAdminLevel] >= 4)
{
new targetid,string[256];
if(sscanf(params, "u", targetid)) SendClientMessage(playerid,-1,""chat" /explode [playerid]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
new Float:x,Float:y,Float:z;
GetPlayerPos(targetid,Float:x,Float:y,Float:z);
CreateExplosion(Float:x,Float:y,Float:z,0,5.0);
format(string, sizeof(string), ""chat""COL_LIGHTBLUE"{00CC66} %s %s has exploded %s.",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid));
SendClientMessageToAll(-1,string);
}
else {
SendClientMessage(playerid,-1,""chat""COL_GRUEN" You have not the sufficient privileges to use this command.");
}
}
else {
SendClientMessage(playerid,-1,""chat" You are not logged in!");
Kick(playerid);
}
return 1;
}
pawn Код:
if(sscanf(params, "u", targetid)) SendClientMessage(playerid,-1,""chat" /explode [playerid]");
pawn Код:
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid,-1,""chat" /explode [playerid]");