Nuke command not working properly.
#5

found some literal "or" and "and" XD

make sure you have the latest a_samp.inc
https://sampwiki.blast.hk/wiki/CreateExplosionForPlayer
pawn Код:
CMD:nuke(playerid, params[])
{
    if(InDMArena[playerid])
    {
        return SCM(playerid, red, "[ERROR]"COL_WHITE" You cannot use this command while in the DM stadium.");
    }
    if(gTeam[playerid] != TEAM_TFH)
    {
        return SCM(playerid, red, "[ERROR]"COL_WHITE" Only horsemen can nuke players.");
    }
    if(IsPlayerInAnyVehicle(playerid))
    {
        return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]"COL_WHITE" You cannot burn someone while in a vehicle. Exit the vehicle first.");
    }
    if(HasNukedRecently[playerid])
    {
        new string[90];
        format(string, sizeof(string), "[ERROR]"COL_WHITE" Please wait "COL_RED"%d seconds"COL_WHITE" before burning someone again.", HasNukedRecently[playerid]);
        return SCM(playerid, red, string);
    }
    if(pInfo[playerid][XP] < 2000) return SCM(playerid, red, "[ERROR]"COL_WHITE" Insufficient XP (2000)");
    new index;
    foreach(new i : Player)
    {
        if(i == playerid) continue;
        if(GetDistanceBetweenPlayers(playerid, i) > 4.0) continue;
        if(aDuty[i] || gTeam[i] == TEAM_TFH) continue;
        GetPlayerPos(i, x, y, z);
        CreateExplosionForPlayer(i,x, y , z + 2, 1, 10.0); // make sure you have the latest a_samp.inc (hint its in samp version 0.3z R2-2
        SetPlayerHealth(i, 0.0);
        new string[120];
        format(string, sizeof(string), "[NUKED]"COL_WHITE" %s[%d] has been killed by horseman %s[%d]'s nuke ability.", GetName(i), i, GetName(playerid), playerid);
        SCMToAll(red, string);
        index++;
    }
    if(index==0)
    {
        return SCM(playerid, red, "[ERROR]"COL_WHITE" No player is in range.");
    }
    pInfo[playerid][XP] -= 2000;
    HasNukedRecently[playerid] = 500;
    format(string, sizeof(string), "[NUKE]"COL_WHITE" Horseman %s[%d] has used his/her nuke abillity.", GetName(playerid), playerid);
    SendClientMessageToAll(COLOR_TFH, string);
   
}
Reply


Messages In This Thread
Nuke command not working properly. - by iSkate - 02.11.2014, 10:35
Re: Nuke command not working properly. - by iSkate - 02.11.2014, 16:43
Re: Nuke command not working properly. - by [HiC]TheKiller - 02.11.2014, 19:15
Re: Nuke command not working properly. - by Threshold - 02.11.2014, 22:10
Re: Nuke command not working properly. - by Quickie - 03.11.2014, 02:08
Re: Nuke command not working properly. - by iSkate - 04.11.2014, 18:31

Forum Jump:


Users browsing this thread: 1 Guest(s)