CMD Disable
#4

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
Create a global variable, make it 1, set a timer, when timer ends, set var 0. if var == 1, return.
e.g:

pawn Код:
new g_var[MAX_PLAYERS];
forward CountDown(playerid);
public CountDown(playerid)
{
    g_var[playerid] = 0;
}
CMD:dropcar(playerid, params[])
{
    new string[128];
    new vehicleid = GetPlayerVehicleID(playerid);
    if(g_var[playerid] == 1) return SendClientMessage(playerid,COLOR_GREY,"You need to wait (INSERT TIME) to use this command again.");
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!vehicleid) return SendClientMessage(playerid, COLOR_GREY, "You must be inside a vehicle to use this command.");
    if(dropping[playerid] == false) return format(string, sizeof(string), "You need to wait {FF6347}%d{33CCF}more seconds before doing dropcar again.", DropTime[playerid]),SendClientMessage(playerid, COLOR_GREY, string);
    if(GetPlayerVehicleID(playerid) != 0)
    {
        DisablePlayerCheckpoint(playerid);
        SetPlayerCheckpoint(playerid, 2505.8506, -2629.0144, 13.2944, 5);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Deliver car to the Los Santos Docks!");
        g_var[playerid] = 1;
        SetTimerEx("CountDown",TimeYouWant, false, "d", playerid);
    }
    return 1;
}
You want me to just create new variable ?
Reply


Messages In This Thread
CMD Disable - by weedxd - 18.09.2014, 13:47
Re: CMD Disable - by Eth - 18.09.2014, 14:33
Re: CMD Disable - by DaniceMcHarley - 18.09.2014, 15:05
Re: CMD Disable - by weedxd - 18.09.2014, 15:20
Re: CMD Disable - by shourya12 - 18.09.2014, 15:24
Re: CMD Disable - by weedxd - 18.09.2014, 15:25
Re: CMD Disable - by shourya12 - 18.09.2014, 15:29
Re: CMD Disable - by weedxd - 18.09.2014, 15:37
Re: CMD Disable - by DaniceMcHarley - 18.09.2014, 16:00
Re: CMD Disable - by weedxd - 18.09.2014, 16:03

Forum Jump:


Users browsing this thread: 1 Guest(s)