Moving gate...
#5

Hi!

I hope this is that what you want.
PHP код:
//global:
new object,bool:gateOpen;
//OnGameModeInit:
object CreateObject(985,1545.1000000,-1627.6000000,14.1000000,0.0000000,0.0000000,90.000 0000);
//OnGameModeInit:
SetTimer("OpenGateAuto",1000,1);
//callback #1:
forward OpenGateAuto();
public 
OpenGateAuto()
{
    for(new 
i;i<MAX_PLAYERS;i++)
    {
        if(!
IsPlayerConnected(i) || IsPlayerNPC(i))continue;
        if(
SpielerInfo[i][Fraction] != || SpielerInfo[i][Fraction] != 2)continue;//fraction query; you can optimized this
        
if(gateOpen == true)break;
        
MoveObject(object1545.1000000, -1620.100000014.10000001.0);
        
gateOpen true;
        
SetTimer("CloseGateAuto",1000,1);
    }
    return 
1;
}
//callback #2:
forward CloseGateAuto();
public 
CloseGateAuto()
{
    
MoveObject(object1545.1000000,-1627.6000000,14.10000001.0);
    
gateOpen false;
    return 
1;

Reply


Messages In This Thread
Moving gate... - by Bulgaria - 29.03.2016, 08:03
Re: Moving gate... - by Logic_ - 29.03.2016, 08:37
Re: Moving gate... - by saffierr - 29.03.2016, 08:41
Re: Moving gate... - by Bulgaria - 29.03.2016, 20:19
Re: Moving gate... - by Mencent - 29.03.2016, 20:28
Re: Moving gate... - by Bulgaria - 30.03.2016, 06:45
Re: Moving gate... - by Mencent - 30.03.2016, 08:10

Forum Jump:


Users browsing this thread: 3 Guest(s)