Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- //=========================[Colores]=========================//
- #define amarillo 0xFFE700FF
- #define rojo 0xFF0000FF
- //========================[FORWARDs]=========================//
- forward SubirBarrera();
- forward BajarBarrera();
- //==========================[NEWs]===========================//
- new barrera;
- new moviendo_barrera = 0;
- //===========================================================//
- public OnFilterScriptInit()
- {
- print("\n+======================+");
- print("| Barrera Los Santos |");
- print("| by |");
- print("| Gantzyo |");
- print("+======================+\n");
- CreateObject(966,1544.696,-1630.775,12.350,0.0,0.0,-90.000);
- CreateObject(966,1544.665,-1630.773,12.350,0.0,0.0,-90.000);
- barrera = CreateObject(968,1544.619,-1623.936,13.111,0.0,90.000,-90.000);//1544.619,-1623.936,13.111,0.0,0.000,-90.000
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n+======================+");
- print("| Barrera Los Santos |");
- print("| by |");
- print("| Gantzyo |");
- print("+======================+\n");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext,"/barrera",true))
- {
- if(moviendo_barrera > 0) return SendClientMessage(playerid,rojo,"Ya se esta abriendo la barrera");
- SetTimer("SubirBarrera",30,0);
- moviendo_barrera = 1;
- return 1;
- }
- return 0;
- }
- public SubirBarrera()
- {
- if(moviendo_barrera == 1)
- {
- new Float:rotX,Float:rotY,Float:rotZ;
- GetObjectRot(barrera,rotX,rotY,rotZ);
- SetObjectRot(barrera,rotX,rotY-1,rotZ);
- if(rotY-1 == 0.000)
- {
- SetTimer("BajarBarrera",3000,0);
- moviendo_barrera = 2;
- }
- else SetTimer("SubirBarrera",30,0);
- }
- return 1;
- }
- public BajarBarrera()
- {
- if(moviendo_barrera == 2)
- {
- new Float:rotX,Float:rotY,Float:rotZ;
- GetObjectRot(barrera,rotX,rotY,rotZ);
- SetObjectRot(barrera,rotX,rotY+1,rotZ);
- if(rotY+1 == 90.000) moviendo_barrera = 0;
- else SetTimer("BajarBarrera",30,0);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment