Rob help
#1

pawn Код:
CMD:robcasino(playerid, params[])
    {
        new sendername[MAX_PLAYER_NAME];
        new string[128];
        if(IsPlayerConnected(playerid))
        if(PlayerToPoint(10.0, playerid, 821.8011,10.8495,1004.1945))
        {
            SendClientMessage(playerid,COLOR_RED,"Du raubst das Casino aus, warte 30 Sekunden...");
            SendClientMessage(playerid,COLOR_LIGHTRED,"Admin Warnung | Wenn du /robcasino spammst wirst du gebannt!");
            WantedPoints[playerid]+=6;
            SetPlayerCriminal(playerid,255, "Casinoraub");
            TogglePlayerControllable(playerid, 0);
            SetTimerEx("Unfreezeply",29000,false,"i",playerid);
            GetPlayerName(playerid, sendername, sizeof(sendername));
            ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,1,1,1,0);
            SetTimerEx("PljackaBankeT", 29000, false, "i", giveplayerid);
            SetTimerEx("RandomPljacka", 30000, false, "d",playerid);
            format(string, sizeof(string), "%s beginnt das Casino auszurauben!", sendername);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            return 1;
        }
        return 1;
    }
Now i need your help, how can i do it like if a player types /robcasino he can do it again but after 2 hours? because it can get spammed and the player gets a lot money. Can you give some code? If you post a working code i will give you +rep
Reply
#2

Use timer.
f.e (YES EXAMPLE):
pawn Код:
//Global
new bool:RobHungry[MAX_PLAYERS];

//Inside rob command
RobHungry[playerid] = true;
SetTimerEx("CanRobAgain",2hourshere,false,"d",playerid);


public RobAgain(playerid)
{
   RobHungry[playerid] = false;
Reply
#3

Nah doesn't work
Reply
#4

What is not working? Are you getting errors? What's the problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)