/escape command how add timer and fail?
#3

Not quite familiar with randoms, so don't go all up on my ass about this.

pawn Код:
dcmd_escape(playerid,params[])
{
    #pragma unused params
    new string[128];
    new ID;


    //Others
    ResetPlayerWeapons(ID);

    new rnd = random(4);
    if(rnd == 1)
    {
        SendClientMessage(playerid,COLOR_RED,"[[_You Have Escaped From Jail!_]]");
        SendClientMessage(playerid,COLOR_PINK,"A better /escape command");
        SendClientMessage(playerid,COLOR_PINK,"Coming Soon!");
        JailTime[ID] =1;
        IsCuffed[ID] =0;
        CuffTime[ID] =0;
        TotalJailTime[ID] =1;
        SetPlayerInterior(ID,10);
        TogglePlayerControllable(ID,1);
        SetPlayerWantedLevel(ID,6);
        SetPlayerToTeamColour(ID);
    }
    return 1;
}
You can try something like that. I made it randomize 1-4, so, if I am correct, 25% of the time you escape, since it checks if the random became 1.
Reply


Messages In This Thread
/escape command how add timer and fail? - by UserName31 - 03.07.2012, 04:52
Re: /escape command how add timer and fail? - by $$inSane - 03.07.2012, 04:55
Re: /escape command how add timer and fail? - by Kindred - 03.07.2012, 04:57
Re: /escape command how add timer and fail? - by UserName31 - 03.07.2012, 04:58
Re: /escape command how add timer and fail? - by UserName31 - 03.07.2012, 05:00

Forum Jump:


Users browsing this thread: 1 Guest(s)