ZCMD Help!
#1

Hello all, I need to set a timer for my bank robbery system, i need too set a Timer on this line.
Код:
 GivePlayerCash(playerid, 400000);
Anyone be able to help me out, thank you very much.

Код:
//START: Reset Bank Robbery Command

CMD:resetbank(playerid, params[])
{
        if( PlayerInfo[ playerid ] [ pAdmin ] >= 99999 ) {
                                                BankRobbedRecently = 0;
                                                for(new i = 0; i < MAX_PLAYERS; i++)
{
     PlayerInfo[i][pRobTime] = 0;
}
                                 new string[128];
                          format( string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has reset the bank robbery timer.", GetPlayerNameEx( playerid ) );
                          ABroadCast( COLOR_YELLOW, string, 4 );
                }
                else {
                    SendClientMessageEx( playerid, COLOR_GREY, "Command is not in your authority to be used!" );
                }
        return 1;
}

//END: Reset Bank Robbery Command

//START: Bank Robbery Command

forward UnsetBankRob();
public UnsetBankRob()
{
        BankRobbedRecently = 0;
        return 1;
}
CMD:robbank(playerid, params[])
        {
            new success = random(2);
            if(BankRobbedRecently == 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "* This location was robbed recently, try again later");
                    return 1;
                }
                if(PlayerInfo[playerid][pRobTime] >= 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "* You already attempted or robbed a place recently, please wait.-jake is god");
                    return 1;
                }



     if(!IsAtRobBankPoint(playerid))
            {
                if(GetPlayerWeapon(playerid) >= 24 && GetPlayerWeapon(playerid) <= 40)
                        {
                        if(PlayerInfo[playerid][pDuty] == 0)
                                {
                                if(success == 1)
                                        {
                                        SendClientMessage(playerid, COLOR_ORANGE, "* You are now Robbing the Los Santos bank, please remain in the checkpoint for 500 Seconds!");
                            RobbingTime[playerid] = 30;
                                    WantedPoints[playerid] = 6;
                                    SetPlayerCriminal(playerid,255, "Robbing the Bank");
                                    PlayerInfo[playerid][pRobTime] = 0;
                                    BankRobbedRecently = 1;
                                                                        GivePlayerCash(playerid, 400000);
                                                                        SetTimerEx("UnsetBankRob", 21600000, true, "i", playerid);

                                        }
                                        else
                                        {
                                            SendClientMessage(playerid, COLOR_ORANGE, "* You failed to rob the Bank!");
                                                                                        WantedPoints[playerid] = 2;
                                                    SetPlayerCriminal(playerid,255, "Attempted to rob the Bank");
                                                PlayerInfo[playerid][pRobTime] = 0;
                                        }
                                }
                                else
                                {
                                    SendClientMessage(playerid, COLOR_GREY, "* Go Off duty first!");
                                    return 1;
                                }
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "* You need a deadly weapon to perform this Act!");
                            return 1;
                        }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "* You're not at the Bank Rob Point!");
                    return 1;
                }
                return 1;
        }

//END: Bank Robbery Command
Hole code for you to read over.
Reply
#2

Read over the wiki, it may help you...

https://sampwiki.blast.hk/wiki/SetTimer
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)