David_Armano Donator
Posts : 62 Join date : 2011-10-10
| Subject: Tired system Tue Oct 25, 2011 6:42 pm | |
| here i made some scripting i hope you like it - Code:
-
enum pInfo { Sleeping, Awake, Tired } new Info[MAX_PLAYERS][pInfo];
SetTimer("Motels",5000,1); SetTimer("SleepTime",300000,1);
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; } }
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; }
| |
|