Lil' help
#3

This should work:
pawn Код:
if(PInfo[playerid][ZPerk] == 14) {
    if(PInfo[playerid][GodDig] == 1) {
        return SendClientMessage(playerid,red,"You are to tired to dig!");
    }
    new
        Float: afPos[3],
        iClosest = -1
    ;
    GetPlayerPos(playerid, afPos[0], afPos[1], afPos[2]);
   
    for(new i = 0, Float: fRange = Float: 0x7F800000, Float: fDist; i < MAX_PLAYERS; ++i) {
        if(!IsPlayerConnected(i) || Team[i] != HUMAN)
            continue;
       
        fDist = GetPlayerDistanceFromPoint(i, afPos[0], afPos[1], afPos[2]);
       
        if(fDist < fRange) {
            iClosest = i;
            fRange = fDist;
        }
    }
    if(iClosest == -1) {
        return SendClientMessage(playerid,red,"It seems like the server is empty o.o'");
    }
    PInfo[playerid][GodDig] = 1;
    SetTimerEx("DigToPlayer", 3000, false, "ii", playerid, iClosest);
    ApplyAnimation(playerid, "RIFLE", "RIFLE_crouchload", 0.5, 0, 0, 0, 1, 3000, 1);
   
    static
        string[120]
    ;
    format(string,sizeof string,"%s(%i) has god digged. Keep an eye on him. || 1 GOD DIG PER ROUND!",GetPName(playerid),playerid);
    SendAdminMessage(red,string);
}
Reply


Messages In This Thread
Lil' help - by FireCat - 23.05.2012, 13:21
Re: Lil' help - by ViniBorn - 23.05.2012, 14:20
Re: Lil' help - by RyDeR` - 23.05.2012, 14:29
Re: Lil' help - by FireCat - 23.05.2012, 14:31

Forum Jump:


Users browsing this thread: 1 Guest(s)