Time Functions Help for REP +
#2

pawn Код:
new HasAttemptedToLoadPackagesRecently[MAX_PLAYERS]; //Under Includes - Global

public OnGameModeInit() //Or FilterScriptInit() if you're using a FilterScript
{
    SetTimer("Check", 1000, true);
    return 1;
}

//LOADPACKAGES COMMAND HERE
{
//Add other code here
if(HasAttemptedToLoadPackagesRecently[playerid] > 0)
return SendClientMessage(playerid, 0xFF0000AA, "You must wait 30 minutes before attempting to load packages again.");

//When player loads the packages
HasAttemptedToLoadPackagesRecently[playerid] = 1800000;
}

forward Check();
public Check()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(HasAttemptedToLoadPackagesRecently[i] >= 1)
            {
                HasAttemptedToLoadPackagesRecently[i] --;
            }
        }
    }
    return ;
}
EDIT: Can't do it fully unless you can supply me with your LoadPackages command.
Reply


Messages In This Thread
Time Functions Help for REP + - by WinterAce - 12.07.2012, 13:12
Re: Time Functions Help for REP + - by clarencecuzz - 12.07.2012, 13:19
Re: Time Functions Help for REP + - by WinterAce - 12.07.2012, 14:35
Re: Time Functions Help for REP + - by clarencecuzz - 12.07.2012, 14:58
Re: Time Functions Help for REP + - by WinterAce - 12.07.2012, 15:23

Forum Jump:


Users browsing this thread: 1 Guest(s)