Game time
#6

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;

Reply


Messages In This Thread
Game time - by sscarface - 24.06.2015, 14:12
Re: Game time - by Youssef221 - 24.06.2015, 14:20
Re: Game time - by nezo2001 - 24.06.2015, 14:21
Re: Game time - by sscarface - 24.06.2015, 14:23
Re: Game time - by Youssef221 - 24.06.2015, 14:25
Re: Game time - by Banana_Ghost - 24.06.2015, 14:42
Re: Game time - by sscarface - 24.06.2015, 14:49
Re: Game time - by Banana_Ghost - 24.06.2015, 14:54
Re: Game time - by STONEGOLD - 24.06.2015, 15:02

Forum Jump:


Users browsing this thread: 1 Guest(s)