SA-MP Forums Archive
[Include] S32_AutoGates - Create automatic gate with just one line! - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] S32_AutoGates - Create automatic gate with just one line! (/showthread.php?tid=317055)



S32_AutoGates - Create automatic gate with just one line! - System64 - 09.02.2012

Introduction

Hi all
Just another script by me, easy automatic gates making, with one line, cool?



Features

Functions
pawn Code:
/*

 • Function: CreateAutoGate(modelid, Float: X, Float: Y, Float: Z, Float: rX, Float: rY, Float: rZ, Float: NewX, Float: NewY, Float: NewZ, Float: Speed)
 • Usage: Creating automatic gate!
 • Parameters:
        modelid: ID of object
        X, Y, Z, rX, rY, rZ: position and rotation of object
        NewX, NewY, NewZ: New poistion of object
        Speed: Speed of object when he moves
 • Example: CreateAutoGate(969, 1019.00000000,-1846.69995117,12.30000019,0.00000000,0.00000000,280.00000000, 1019.00000000,-1846.69995117,9.60000038, 3.0);

*/


/*

 • Function: DestroyAutoGate(gateid)
 • Usage: Destroying automatic gate!
 • Parameters:
        gateid: ID of specific gate
 • Example: DestroyAutoGate(1);

*/


/*

 • Function: GetTotalAutoGates()
 • Usage: Getting all created gates!
 • Parameters:
        no parameteres
 • Example: printf("Total auto gates: %d", GetTotalAutoGates());

*/


/*

 • Function: GetAutoGatePos(gateid, &Float: x, &Float: y, &Float: z)
 • Usage: Getting position of gate!
 • Parameters:
        X, Y, Z: Parameters in which will be stored position
 • Example:
 new Float: Pos[3];
 GetAutoGatePos(2, Pos[0], Pos[1], Pos[2]);
 printf("Gate X: %f, Gate Y: %f, Gate Z: %f", Pos[0], Pos[1], Pos[2]);

*/


/*

 • Function: GetAutoGateNewPos(gateid, &Float: x, &Float: y, &Float: z)
 • Usage: Getting new position of autogate!
 • Parameters:
        X, Y, Z: Parameters in which will be stored new position
 • Example:
 new Float: Pos[3];
 GetAutoGateNewPos(2, Pos[0], Pos[1], Pos[2]);
 printf("Gate New X: %f, Gate New Y: %f, Gate New Z: %f", Pos[0], Pos[1], Pos[2]);

*/


/*

 • Function: GetAutoGateRot(gateid, &Float: x, &Float: y, &Float: z)
 • Usage: Getting rotation of gate!
 • Parameters:
        X, Y, Z: Parameters in which will be stored rotation
 • Example:
 new Float: Pos[3];
 GetAutoGateRot(2, Pos[0], Pos[1], Pos[2]);
 printf("Gate rot X: %f, Gate rot Y: %f, Gate rot Z: %f", Pos[0], Pos[1], Pos[2]);

*/


/*

 • Function: IsPlayerInRangeOfAutoGate(playerid, gateid, Float: Range)
 • Usage: Checking is player in range of specific gate!
 • Parameters:
        playerid: ID of player
        gateid: ID of gate
        Range: range in which can player be
 • Example:
 if(IsPlayerInRangeOfAutoGate(playerid, 4, 10.0) SendClientMessage(playerid, -1, "You are in range of auto gate 4");

*/


/*

 • Function: IsPlayerInRangeOfAnyAutoGate(playerid, Float: Range)
 • Usage: Checking is player in range of any gate!
 • Parameters:
        playerid: ID of player
        Range: range in which can player be
 • Example:
 if(IsPlayerInRangeOfAnyAutoGate(playerid, 10.0) SendClientMessage(playerid, -1, "You are in range of some auto gate");

*/


/*

 • Function: GetAutoGateModelID(gateid)
 • Usage: Getting the model of gate!
 • Parameters:
        gateid: ID of gate
 • Example:
 printf("Model ID of gate 2 is: %d", GetAutoGateModelID(2));
 
*/


/*

 • Function: GetAutoGateSpeed(gateid, &Float: Speed)
 • Usage: Getting the speed of gate!
 • Parameters:
        gateid: ID of gate
        Speed: Parametere in which will be stored speed
 • Example:
 new Float: Speed;
 GetAutoGateSpeed(12, Speed);
 printf("Speed of gate 12 is: %f", Speed);

*/


/*

 • Function: IsValidAutoGate(gateid)
 • Usage: Checking is specific gate valid gate!
 • Parameters:
        gateid: ID of gate
 • Example:
 if(IsValidAutoGate(2)) printf("Gate 2 is valid!");

*/

Necessary things

y_timers by Y_Less
foreach by Y_Less



Download

Pastebin (v1.0.0)


Mediafire (v1.0.0)


Solidfiles (v1.0.0)



Credits

System32 - Almost everything
Y_Less - y_timers & foreach



Re: S32_AutoGates - Create automatic gate with just one line! - fiki574 - 09.02.2012

Very nice, gonna use it!

(It wont allow me to add rep+, wth)


Re: S32_AutoGates - Create automatic gate with just one line! - SpiderWalk - 09.02.2012

Nice


Re: S32_AutoGates - Create automatic gate with just one line! - Adzdon - 09.02.2012

Coool


Re : S32_AutoGates - Create automatic gate with just one line! - Varkoll_ - 09.02.2012

Good job, i will use it for my gamemode !


Re: S32_AutoGates - Create automatic gate with just one line! - System64 - 10.02.2012

thanks guys!

@fiki - Lol when I want to give you rep. I get that fucking message :S


Re: S32_AutoGates - Create automatic gate with just one line! - Brka - 10.02.2012

Nice dude very nice


Re: S32_AutoGates - Create automatic gate with just one line! - niels44 - 10.02.2012

eehm i get this errors when adding it to my script:
Code:
D:\Program Files\[0.3d]my own drifting gamemode\pawno\include\S32_AutoGates.inc(26) : error 001: expected token: ";", but found "-identifier-"
D:\Program Files\[0.3d]my own drifting gamemode\pawno\include\S32_AutoGates.inc(268) : error 010: invalid function or declaration
D:\Program Files\[0.3d]my own drifting gamemode\pawno\include\S32_AutoGates.inc(270) : error 010: invalid function or declaration
D:\Program Files\[0.3d]my own drifting gamemode\pawno\include\S32_AutoGates.inc(272) : error 010: invalid function or declaration
D:\Program Files\[0.3d]my own drifting gamemode\pawno\include\S32_AutoGates.inc(274) : error 010: invalid function or declaration
D:\Program Files\[0.3d]my own drifting gamemode\pawno\include\S32_AutoGates.inc(275) : error 010: invalid function or declaration
D:\Program Files\[0.3d]my own drifting gamemode\pawno\include\S32_AutoGates.inc(278) : error 010: invalid function or declaration
D:\Program Files\[0.3d]my own drifting gamemode\pawno\include\S32_AutoGates.inc(279) : error 010: invalid function or declaration
D:\Program Files\[0.3d]my own drifting gamemode\pawno\include\S32_AutoGates.inc(281) : error 010: invalid function or declaration
D:\Program Files\[0.3d]my own drifting gamemode\gamemodes\TorettoRacing1.pwn(15513) : warning 203: symbol is never used: "YSI_gS"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


9 Errors.
pls help with this...


Re: S32_AutoGates - Create automatic gate with just one line! - System64 - 10.02.2012

Did you just put it as include or you integrer it in your script?

Also did you edit script?

Line 26 in my include is

new Iterator: AutoGates<MAX_AUTOGATES>, agID;

but there is ;


Re: S32_AutoGates - Create automatic gate with just one line! - Danny1 - 10.02.2012

Nice work System64.


Re: S32_AutoGates - Create automatic gate with just one line! - -Prodigy- - 10.02.2012

Tips:
* Why use y_timers when you only use a function once? That just requires extra download + includes to have for one function. (Regular timer will do)

* Include all the necessary includes in the download


Re: S32_AutoGates - Create automatic gate with just one line! - System64 - 10.02.2012

So, with y_timers is more optimized, if you are to lazy, I don't care about it

I wont, you know how to use search on this forum or ******!


Re: S32_AutoGates - Create automatic gate with just one line! - niels44 - 11.02.2012

i used it as include... but whats wrong then? do i have to add something to my script?


Re: S32_AutoGates - Create automatic gate with just one line! - System64 - 11.02.2012

hmm, strange problems...

You just put #include <S32_AutoGates> and than you got the errors?


Re: S32_AutoGates - Create automatic gate with just one line! - -Prodigy- - 11.02.2012

Quote:
Originally Posted by System64
Посмотреть сообщение
So, with y_timers is more optimized, if you are to lazy, I don't care about it

I wont, you know how to use search on this forum or ******!
Didn't expected a rude reply. Also, since when is y_timers optimized? Seriously, having to load the whole YSI system just for 1 timer?

I'm not even going to use this system, but ( guy in first page reporting errors ), it should be easier for the guys that download it to use the system at ease.

(Also, foreach was implemented in ysi, why have it as a separate inc?)


Re: S32_AutoGates - Create automatic gate with just one line! - System64 - 11.02.2012

Quote:
Originally Posted by -Prodigy-
Посмотреть сообщение
Didn't expected a rude reply. Also, since when is y_timers optimized? Seriously, having to load the whole YSI system just for 1 timer?

I'm not even going to use this system, but ( guy in first page reporting errors ), it should be easier for the guys that download it to use the system at ease.

(Also, foreach was implemented in ysi, why have it as a separate inc?)
Will you stop complain about YSI?

If they don't want this system they wont download it and use it, if they want they will download system and YSI


Re: S32_AutoGates - Create automatic gate with just one line! - niels44 - 14.02.2012

yes i just include it and then get that errors... and when i remove the include from my gm then it doesnt gives errors...

btw im using my gamemode TorettoRacing, maybe you should download it from my publish thing and check if it compiles with it....( i have edited mine but maybe it will also give the errors in that script i have)


Re: S32_AutoGates - Create automatic gate with just one line! - System64 - 14.02.2012

umm, no idea, i'll try to help you when I get home


Re: S32_AutoGates - Create automatic gate with just one line! - ejul - 18.06.2012

Nice


Re: S32_AutoGates - Create automatic gate with just one line! - Rudy_ - 18.06.2012

wow nice work man