help dynamic rob point
#3

I see ur RobFail, and it's useless...
I've edited it a little bit. Didn't test but it should work.
pawn Код:
CMD:rob(playerid,params[])
{
    for(new i=0; i<MAX_PICK; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid,2,PickInfo[i][pX], PickInfo[i][pY], PickInfo[i][pZ]) && GetPlayerVirtualWorld(playerid) == PickInfo[i][pVw] && GetPlayerInterior(playerid) == PickInfo[i][pInt])
        {
            ApplyAnimation(playerid, "ROB_BANK", "CAT_SAFE_ROB", 4.0, 1, 0, 0,0, 1);
            robtime = SetTimer("robtimer",1000,true);
        }
        else
        {
            return SCM(playerid,-1,"You are not in a rob point");
        }
    }
    return 1;
}
forward robtimer(playerid);
public robtimer(playerid)
{
    for(new i=0; i<MAX_PICK; i++)
    {
        CountDownVar--;
        new str[128];
        format(str, sizeof(str), "Count Down: %d",CountDownVar);
        GameTextForPlayer(playerid,str,1000,6);
        if(CountDownVar == 0)
        {
            if(!IsPlayerInRangeOfPoint(playerid,1.0,PickInfo[i][pX], PickInfo[i][pY], PickInfo[i][pZ]) || GetPlayerVirtualWorld(playerid) != PickInfo[i][pVw] || GetPlayerInterior(playerid) != PickInfo[i][pInt])
        {
            KillTimer(robtime);
            ClearAnimations(playerid);
            CountDownVar = 15;
            return SCM(playerid,-1, "[ROBBERY]: Robbery has failed");
            }
            new rand = random(999);
            GiveDrichMoney(playerid,rand);
            format(str,128," %s has robbed %i",GetName(playerid),rand);
            SCM(playerid,-1,str);
            ClearAnimations(playerid);
            KillTimer(robtime);
            CountDownVar = 15;
        }
    }
    return 1;
}
And btw, nice userbars :>
Reply


Messages In This Thread
help dynamic rob point - by drichie - 04.07.2013, 06:26
Re: help dynamic rob point - by Goldilox - 04.07.2013, 06:56
Re: help dynamic rob point - by GeniusPobs - 04.07.2013, 07:20
Re: help dynamic rob point - by drichie - 04.07.2013, 07:57
Re: help dynamic rob point - by Vince - 04.07.2013, 08:04
Re: help dynamic rob point - by drichie - 04.07.2013, 08:16

Forum Jump:


Users browsing this thread: 2 Guest(s)