28.01.2007, 17:43
only 1 vehicle can be locked with the lock i posted
you need maxvehicles for all of them to be unlocked
Everybody needs sleep Code
you need maxvehicles for all of them to be unlocked
Everybody needs sleep Code
pawn Code:
enum pInfo
{
Sleeping,
Awake,
Tired
}
new Info[MAX_PLAYERS][pInfo];
pawn Code:
SetTimer("Motels",5000,1);
SetTimer("SleepTime",300000,1);
pawn Code:
public SleepTime()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
SendClientMessage(i,COLOR_GREY,"* You are starting to feel sleep *");
SendClientMessage(i,COLOR_GREY,"* Go to the nearest /hotel and get a rest *");
Info[i] [Tired] = 1;
Info[i] [Awake] = 0;
Info[i] [Sleeping] = 0;
}
}
pawn Code:
public Motels()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInCube(i,2236,-1076,1040,2245,-1066,1100))
{
if(Info[i][Tired] == 1)
{
GameTextForPlayer(i,"~w~Please wait while your energy is ~b~restored",3000,3);
Info[i] [Tired] = 0;
Info[i] [Sleeping] = 1;
Info[i] [Awake] = 0;
TogglePlayerControllable(i,0);
}
if(Info[i] [Awake] == 1)
{
GameTextForPlayer(i,"~w~You ~g~don't ~w~need to rest",2000,3);
}
if(Info[i] [Sleeping] == 1)
{
Info[i] [Awake] = 1;
Info[i] [Tired] = 0;
Info[i] [Sleeping] = 0;
GameTextForPlayer(i,"~w~Rise and Shine",2000,3);
TogglePlayerControllable(i,1);
}
}
if(IsPlayerInCube(i,2202,-1070,1000,2211,-1078,1100))
{
if(Info[i][Tired] == 1)
{
GameTextForPlayer(i,"~w~Please wait while your energy is ~b~restored",3000,3);
Info[i] [Tired] = 0;
Info[i] [Sleeping] = 1;
Info[i] [Awake] = 0;
TogglePlayerControllable(i,0);
}
if(Info[i] [Awake] == 1)
{
GameTextForPlayer(i,"~w~You ~g~don't ~w~need to rest",2000,3);
}
if(Info[i] [Sleeping] == 1)
{
Info[i] [Awake] = 1;
Info[i] [Tired] = 0;
Info[i] [Sleeping] = 0;
GameTextForPlayer(i,"~w~Rise and Shine",2000,3);
TogglePlayerControllable(i,1);
}
}
}
return 1;
}