12.07.2012, 13:19
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 ;
}