Aim at NPC to start Rob!
#3

I created one like this:
pawn Code:
forward RobCluckin(playerid);

public RobCluckin(playerid)
{
    new rand = random(5000)+0;
    GivePlayerMoney(playerid,rand);
    new pname[MAX_PLAYER_NAME], string[80 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), ""COLOR_RED"[ROBBERY] %s has robbed Cluckin Bell (Downtown) and received %i.", pname, rand);
    SendClientMessageToAll(-1, string);
    return 1;
}

public OnGameModeInit()
{
    ConnectNPC("CluckinBOT","Cluckin");
    CreatePickup(1318, 1, -1816.5437,618.0901,35.1719, 0);
    CreatePickup(1318, 1, 364.8150,-11.6074,1001.8516, 9);
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -1816.5437,618.0901,35.1719))
        {
            SetPlayerPos(playerid, 364.8150,-11.6074,1001.8516);
            SetPlayerInterior(playerid, 9);
        }
        else if(IsPlayerInRangeOfPoint(playerid, 3.0, 364.8150,-11.6074,1001.8516))
        {
            SetPlayerPos(playerid, -1816.5437,618.0901,35.1719);
            SetPlayerInterior(playerid, 0);
        }
    }
    if(PRESSED(KEY_HANDBRAKE))
    {
        new wid = GetPlayerWeapon(playerid);
        if(wid > 10)
        {
            new NPCID = GetPlayerIDFromName("CluckinBOT");
            if(IsPlayerFacingPlayer(playerid,NPCID,10) == 1)
            {
                ApplyAnimation(NPCID,"ped","handsup",3.0,0,0,0,1,0);
                SendClientMessage(playerid, -1, ""COLOR_YELLOW"[WANTED LEVEL] {FFFFFF}Your wanted level is increased by four. (Robbing Cluckin Bell)");
                SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+4);
                SetTimerEx("RobCluckin", 25000, false, "i", playerid);
                SetTimerEx("After1", 50000, false, "i", playerid);
            }
        }
    }
    return 1;
}
How can i get the timer showing like this in a gamemodetext?
"Robbery Time: timer
Please wait until the robbery is done."
Reply


Messages In This Thread
Aim at NPC to start Rob! - by ChandraLouis - 28.04.2017, 05:01
Re: Aim at NPC to start Rob! - by raydx - 28.04.2017, 07:12
Re: Aim at NPC to start Rob! - by ChandraLouis - 28.04.2017, 09:03
Re: Aim at NPC to start Rob! - by iLearner - 28.04.2017, 10:53
Re: Aim at NPC to start Rob! - by ChandraLouis - 28.04.2017, 11:53
Re: Aim at NPC to start Rob! - by Kane - 28.04.2017, 11:56

Forum Jump:


Users browsing this thread: 1 Guest(s)