Explode cmd
#2

pawn Код:
CMD:explode(playerid,params[])
{
    if(PlayerInfo[playerid][Admin] >= 1 || IsPlayerAdmin(playerid))
    {
        if(isnull(params)) return SendClientMessage(playerid, RED, "/explode [target]");
        else
        {
            if(!IsPlayerConnected(strval(params)) || strval(params) == INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "Target ID is not valid.");
            new Float:X, Float:Y, Float:Z, Float:ohp, Float:oar, Float:nhp, Float:nar;
            GetPlayerPos(strval(params), X, Y, Z);
            GetPlayerHealth(strval(params), ohp);
            GetPlayerArmour(strval(params), oar);
            CreateExplosion(X, Y, Z, 7, 500);
            SendClientMessage(playerid, -1, "Target has been exploded. Checking results...");
            GetPlayerHealth(strval(params), nhp);
            GetPlayerArmour(strval(params), nar);
            if(oar == nar) SendClientMessage(playerid, -1, "Target's armour did not change.");
            if(nar != oar) SendClientMessage(playerid, -1, "Target's armour changed.");
            if(ohp == nhp) SendClientMessage(playerid, -1, "Target's health did not change.");
            if(nhp != ohp) SendClientMessage(playerid, -1, "Target's health changed.");
            new stra[110];
            format(stra,sizeof(stra), "(ADMIN) %s(%d) (level: %d) has exploded %s(%d). (/explode)", PlayerName(playerid), playerid, PlayerInfo[playerid][Admin], PlayerName(strval(params)), strval(params));
            SendAdminMessage(stra, 1);
            stra = "\0";
        }
    }
    else return SendClientMessage(playerid, RED, "Access Denied. Admin level 1 is required to use this command.");
    return 1;
}
I think it was defaulting else if.

Try that.

Also take a look at this: https://sampforum.blast.hk/showthread.php?tid=167419
Reply


Messages In This Thread
Explode cmd - by LocMax - 05.04.2014, 07:16
Re: Explode cmd - by Dokins - 05.04.2014, 07:50
Re: Explode cmd - by LocMax - 05.04.2014, 07:54
Re: Explode cmd - by Dokins - 05.04.2014, 08:52
Re: Explode cmd - by LocMax - 05.04.2014, 08:56
Re: Explode cmd - by Dokins - 05.04.2014, 09:06
Re: Explode cmd - by LocMax - 05.04.2014, 09:19
Re: Explode cmd - by Dokins - 05.04.2014, 09:22
Re: Explode cmd - by PrivatioBoni - 05.04.2014, 09:34

Forum Jump:


Users browsing this thread: 1 Guest(s)