gate scripting help
#1

I want a gate openable with a command, basically it is like moveobject but if i type /opengate, it gets opened but after 5 seconds it must be closed back or come to its initial position.. gimme the codes, i'll write coordinates myself, thank you, i'll rep up for sure..
Reply
#2

Not the right section for that... but since i have it in my code, ill post it, but you gotta edit it, gimme 1 min.

PHP код:
new GateBool:Open
ongminit() 
{  
    
//create obj on gminit 
    
Gate CreateDynamicObject(971,1033.2990000,-363.1990000,76.5000000,0.0000000,0.0000000,329.9960000); 

public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys

    if(
PRESSED(KEY_NO)) // key N 
    

        if(
IsPlayerInRangeOfPoint(playerid,3,1037.6825,-366.1670,73.8657) || IsPlayerInRangeOfPoint(playerid,3,1028.8965,-360.5697,73.9318)) //Gate 1 
        

            switch(
Open//Check whether the gate opened or closed 
            

                case 
true//the gate opened 
                

                    
MoveDynamicObject(Gate,1033.2990000,-363.1990000,76.5000000,3.5,0.0000000,0.0000000,329.9960000); //Close the gate 
                    
Open false//false for closed 
                

               case 
false//If the gate closed  
                
{  
                    
MoveDynamicObject(Gate,1028.880,-365.665,76.500,3.5,0.000,0.000,-98.703); //Open the gate  
                    
Open true//true for opened  
                    
SetTimer("closegate"20000false); 
                }  
          }
      }
   }
  return 
1;
}
// the function 
forward closegate(); 
public 
closegate() 

// if the gate is open 
   
if(Open == true
   { 
       
MoveDynamicObject(Gate,1033.2990000,-363.1990000,76.5000000,3.5,0.0000000,0.0000000,329.9960000);       //Close the gate  
      
Open false//false for closed  
      
return 1
  } 

Reply
#3

it's kinda scripting help since u are helping me, i'll understand the code and would never need to be assisted or to urge anyone on sa-mp forums :P
Reply
#4

No, thats a script request actually.
Reply
#5

rep'd up faggot
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)