24.06.2015, 14:42
Let the server control the gametime, example:
PHP код:
#include <a_samp>
new
gametime,
worldtime = 0;
forward UpdateTime();
public OnFilterScriptInit(){
SetWorldTime(worldtime);
gametime = SetTimer("UpdateTime",60*1000,true);
return 1;
}
public OnFilterScriptExit(){
KillTimer(gametime);
return 1;
}
public UpdateTime(){
if(worldtime == 23){
worldtime = 0;
SetWorldTime(worldtime);
}
else{
worldtime ++;
SetWorldTime(worldtime);
}
switch(worldtime){ // An if statement would be fine if you'd like, but less editing would be needed if you wanted to add more time based events later.
case 5: // Either call your moneybag function (if you have it) or just code it under this.
}
return 1;
}