15.08.2010, 01:42
(
Last edited by Correlli; 14/09/2012 at 10:03 PM.
)
What is this?
This is a simple tornado include file. It's maybe not coded in the best way for the RolePlay servers but it could be useful if you want to have some fun.
Screenshots:
http://i36.tinypic.com/30upnbc.png
http://i33.tinypic.com/9acx89.png
http://i35.tinypic.com/6ycghg.png
/imageshack/img185/8789/samp001jr.png
Credits:
- Y_Less for foreach & randomEx function,
- Tannz0rz for smoke-objects idea
How to install?
It's easy and simple - download and put the tornado.inc into the \pawno\include\ folder and do the same thing with the foreach.inc file.
Open your script and put this:
right after the
Put the tornados in the OnGameModeInit callback.
Example:
These 3 tornados are located at the Santa Maria Beach. Here are safe spawn coordinates, a bit away from the tornados:
Functions:
CreateTornado
Adds the tornado to the server.
@Float: x = Tornado start X position.
@Float: y = Tornado start Y position.
@Float: z = Tornado start Z position.
@Float: speed = The speed of tornado, maximum speed is defined with MAX_TORNADO_SPEED and even if you set bigger speed it will still set the speed of MAX_TORNADO_SPEED define.
@Float: range = The maximum allowed range for tornado to move from his starting position. If he is out of this range then he'll return to the starting position.
returns the tornado ID which starts with 0. If you exceed the MAX_TORNADOS define then it will return the invalid ID which is -1.
Example:
DestroyTornado
Deletes the tornado from the server.
@tdid = The tornado ID.
returns true if the tornado is valid and false if it's not.
Example:
IsTornadoCreated
Checks if tornado is created.
@tdid = The tornado ID.
returns true if the tornado is valid and false if it's not.
Example:
Defines:
MAX_TORNADOS - The maximum amount of tornados allowed for script to load on the server.
MAX_TORNADO_SPEED - The maximum speed of the tornado.
P_TO_TORNADO_RANGE - The "player-to-tornado" range. If player is in this range then he'll find himself inside the tornado.
How to get coordinates for tornados?
Just launch the server or join one and go to the position where you want to have the tornado. Then use the /save command and when you're done go to the savedpositions.txt file and get your coordinates (you only need x, y and z).
Download:
http://www.solidfiles.com/d/50103e2415
Other:
When you delete the last tornado then the timer will stop so you don't have to do anything, and when you add the first tornado then it will start again.
If you get caught inside the tornado then you'll be inside for random amount of time (15 - 30 seconds) and once you're out (if you ain't dead yet) you'll have 5 seconds to run away before you're doomed once again.
The smoke objects are not as great as I expected, but they're better than nothing, right? There is also a test gamemode included into the download package.
There is no effect for the players in vehicles in this version.
This is a simple tornado include file. It's maybe not coded in the best way for the RolePlay servers but it could be useful if you want to have some fun.
Screenshots:
http://i36.tinypic.com/30upnbc.png
http://i33.tinypic.com/9acx89.png
http://i35.tinypic.com/6ycghg.png
/imageshack/img185/8789/samp001jr.png
Credits:
- Y_Less for foreach & randomEx function,
- Tannz0rz for smoke-objects idea
How to install?
It's easy and simple - download and put the tornado.inc into the \pawno\include\ folder and do the same thing with the foreach.inc file.
Open your script and put this:
pawn Code:
#include <foreach>
#include <tornado>
pawn Code:
#include <a_samp>
Example:
pawn Code:
/*
CreateTornado(Float:x, Float:y, Float:z, Float:speed, Float:range);
*/
CreateTornado(485.7347, -1833.4973, 5.2154, 7.0, 50.0);
CreateTornado(587.4223, -1880.6510, 4.0786, 5.0, 30.0);
CreateTornado(598.7793, -1850.9843, 5.3381, 10.0, 60.0);
pawn Code:
542.57208252, -1912.07702637, 2.0
Functions:
CreateTornado
Adds the tornado to the server.
@Float: x = Tornado start X position.
@Float: y = Tornado start Y position.
@Float: z = Tornado start Z position.
@Float: speed = The speed of tornado, maximum speed is defined with MAX_TORNADO_SPEED and even if you set bigger speed it will still set the speed of MAX_TORNADO_SPEED define.
@Float: range = The maximum allowed range for tornado to move from his starting position. If he is out of this range then he'll return to the starting position.
returns the tornado ID which starts with 0. If you exceed the MAX_TORNADOS define then it will return the invalid ID which is -1.
Example:
pawn Code:
new
gTornado = -1;
public OnGameModeInit()
{
gTornado = CreateTornado(485.7347, -1833.4973, 5.2154, 7.0, 50.0);
return true;
}
Deletes the tornado from the server.
@tdid = The tornado ID.
returns true if the tornado is valid and false if it's not.
Example:
pawn Code:
DestroyTornado(gTornado);
Checks if tornado is created.
@tdid = The tornado ID.
returns true if the tornado is valid and false if it's not.
Example:
pawn Code:
if(IsTornadoCreated(gTornado)) printf("Tornado is created.");
else printf("Tornado is NOT created.");
pawn Code:
#define MAX_TORNADOS (10)
#define MAX_TORNADO_SPEED (20.0)
#define P_TO_TORNADO_RANGE (45.0)
MAX_TORNADO_SPEED - The maximum speed of the tornado.
P_TO_TORNADO_RANGE - The "player-to-tornado" range. If player is in this range then he'll find himself inside the tornado.
How to get coordinates for tornados?
Just launch the server or join one and go to the position where you want to have the tornado. Then use the /save command and when you're done go to the savedpositions.txt file and get your coordinates (you only need x, y and z).
Download:
http://www.solidfiles.com/d/50103e2415
Other:
When you delete the last tornado then the timer will stop so you don't have to do anything, and when you add the first tornado then it will start again.
If you get caught inside the tornado then you'll be inside for random amount of time (15 - 30 seconds) and once you're out (if you ain't dead yet) you'll have 5 seconds to run away before you're doomed once again.
The smoke objects are not as great as I expected, but they're better than nothing, right? There is also a test gamemode included into the download package.
There is no effect for the players in vehicles in this version.