Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- forward FixHour(hour);
- forward SFAirPort();
- new sfarg1, sfarg2, sfars1, sfars2, sfars3, sfars4, sfareStatus = 1, sfarg1Status = 1, sfarg2Status = 1;
- new timeshift = -1;
- public OnFilterScriptInit()
- {
- sfarg1 = CreateStreamedObject(989, -1547.597900, -428.788361, 6.815458, 0.0000, 0.0000, 241.9707);//SF Air Port Gate1
- sfarg2 = CreateStreamedObject(989, -1543.697266, -432.671570, 6.815458, 0.0000, 0.0000, 241.9707);//SF Air Port Gate2
- sfars1 = CreateStreamedObject(10184, -1394.588013, -267.306000, 7.521763, 0.0000, 0.0000, 270.0000);//SF Air Port Parking Gate1
- sfars2 = CreateStreamedObject(10184, -1394.588013, -267.306000, 12.238979, 179.9087, 0.0000, 270.0000);//SF Air Port Parking Gate1 Higher
- sfars3 = CreateStreamedObject(10184, -1417.434326, -267.306000, 7.489068, 0.0000, 0.0000, 270.0000);//SF Air Port Parking Gate2
- sfars4 = CreateStreamedObject(10184, -1417.434326, -267.306000, 12.238979, 179.9087, 0.0000, 270.0000);//SF Air Port Parking Gate2 Higher
- return 1;
- }
- public OnFilterScriptExit()
- {
- DestroyObjectsCreatedByMe();
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- new hour, minute, second;
- gettime(hour, minute, second);
- FixHour(hour+8);
- if(hour>6 || hour<24)
- {
- if(PlayerToPoint(20, playerid, -1547.597900, -428.788361, 6.815458))
- {
- if(sfareStatus == 1)
- {
- MoveStreamedObject(sfarg1, -1551.483276, -424.904022, 6.815458,3);
- MoveStreamedObject(sfarg2, -1539.796509, -436.567444, 6.815458,3);
- sfareStatus = 0;
- SetTimer("SFAirPort", 5000, false);
- return 1;
- }
- }
- if(PlayerToPoint(20, playerid, -1394.588013, -267.306000, 7.521763))
- {
- if(sfarg1Status == 1)
- {
- MoveStreamedObject(sfars1, -1394.588013, -267.306000, 14.263948,3);
- MoveStreamedObject(sfars2, -1394.588013, -267.306000, 18.981164,3);
- sfarg1Status = 0;
- SetTimer("SFAirPort", 5000, false);
- return 1;
- }
- }
- if(PlayerToPoint(20, playerid, -1417.434326, -267.306000, 7.489068))
- {
- if(sfarg2Status == 1)
- {
- MoveStreamedObject(sfars3, -1417.457764, -267.306000, 14.263948,3);
- MoveStreamedObject(sfars4, -1417.457764, -267.306000, 18.981164,3);
- sfarg2Status = 0;
- SetTimer("SFAirPort", 5000, false);
- return 1;
- }
- }
- }
- return 1;
- }
- public SFAirPort()
- {
- if(sfareStatus == 0)
- {
- MoveStreamedObject(sfarg1, -1547.597900, -428.788361, 6.815458,3);
- MoveStreamedObject(sfarg2, -1543.697266, -432.671570, 6.815458,3);
- sfareStatus = 1;
- return 1;
- }
- if(sfarg1Status == 0)
- {
- MoveStreamedObject(sfars1, -1394.588013, -267.306000, 7.521763,3);
- MoveStreamedObject(sfars2, -1394.588013, -267.306000, 12.238979,3);
- sfarg1Status = 1;
- return 1;
- }
- if(sfarg2Status == 0)
- {
- MoveStreamedObject(sfars3, -1417.457764, -267.306000, 7.521763,3);
- MoveStreamedObject(sfars4, -1417.457764, -267.306000, 12.238979,3);
- sfarg2Status = 1;
- return 1;
- }
- return 1;
- }
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
- public FixHour(hour)
- {
- hour = timeshift+hour;
- if (hour < 0)
- {
- hour = hour+24;
- }
- else if (hour > 23)
- {
- hour = hour-24;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement