pawn Код:
if(strcmp(cmd, "/explode", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 4)
{
SendClientMessage(playerid, COLOR_GREY, "/explode [Playerid]");
return 1;
}
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "AdmCMD: %s was exploded by %s",giveplayer, sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
//SendClientMessageToAll(COLOR_DBLUE, string);
SetPlayerHealth(giveplayerid, 10);
new Float:boomx, Float:boomy, Float:boomz;
GetPlayerPos(giveplayerid,boomx, boomy, boomz);
CreateExplosion(boomx, boomy , boomz, 7, 10);
new PlayerName[30];
GetPlayerName(playerid, PlayerName, 30);
printf("[Command] %s has used /explode to explode %s", PlayerName, giveplayer);
}
else
{
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");
}
return 1;
}
Aver este si te ayudara..