How to set moving gates - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to set moving gates (
/showthread.php?tid=106902)
How to set moving gates -
Mkb122 - 06.11.2009
Hello everyone,
a friend of me have make for me Gates on police department. but i dont know how to change it from place
in Los Santos u get a wall when the climb over the can enter the police garage so i want my gate before the inside of the garage, Can u help me please here u get the script code.
Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz, Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) return 1;
return 0;
}
public OpenPoliceDepartmentGate()
{ if(pdebug == 1){print("[DEBUG] OpenPoliceDepartmentGate()");}
if(city == 1){MoveObject(GatePD, 1539.709717, -1627.873047, 8.057503, 2.0);}
if(city == 2){MoveObject(GatePD, -1571.661133, 656.477478, 6.354377, 2.0);}
return 1;
}
public ClosePoliceDepartmentGate()
{ if(pdebug == 1){print("[DEBUG] ClosePoliceDepartmentGate()");}
if(city == 1){MoveObject(GatePD, 1539.709717, -1627.873047, 14.057503, 2.0);}
if(city == 2){MoveObject(GatePD, -1571.661133, 665.627869, 6.354377, 2.0);}
return 1;
}
Re: How to set moving gates -
Luka P. - 06.11.2009
https://sampwiki.blast.hk/wiki/Automatic_Gates
Re: How to set moving gates -
Mkb122 - 06.11.2009
Lol. i dont understand that shit :S
Re: How to set moving gates -
yugokoral - 06.11.2009
LOL. This is not a shit, this is a usefull code, how to make automatic gate!
Re: How to set moving gates -
Luka P. - 06.11.2009
Quote:
|
Originally Posted by yugokoral
LOL. This is not a shit, this is a usefull code, how to make automatic gate! 
|
yugo = yugoslavia xD sta ima
Quote:
|
Originally Posted by Mkb122
Lol. i dont understand that shit :S
|
Read few times,you'll understand it.
Re: How to set moving gates -
SergiKirov - 07.11.2009
Quote:
yugo = yugoslavia xD sta ima
|
Yugoslavia is AWESOME... not just because of the communism but because of the great name :P
And you will get it after some time! get a book on C++! that helped me understand Pawn code better
Re: How to set moving gates -
Mkb122 - 07.11.2009
Lol thanx now i have it in my server, but can i set that i the not only can open theg ate when whe are cop skins but with rank i have real life mod and there whe can set /setrank ID rank 1 or 2 1 is cop 2 is army