20.12.2017, 08:53
(
Последний раз редактировалось iAmir; 08.07.2018 в 21:19.
)
CreateWater.inc | v2.0
NEW UPDATEFully controllable custom oxygen bar has been added.
Added new functions.
Fixed under water swim move.
Optimized swim/move styles.
Changed function IsPlayerInWaterEx to IsPlayerInCustomWater.
Added a simple example script in github.
----------------------------------------------------------------------------
Start and Informations
So Hi ! , maybe you know I posted it on Screenshot and Videos section and as I said , I'm releasing it now.
About 4years ago that I started scripting in SAMP , I wanted to make pool but I couldn't make it anywhere I wanted
I had to make it on water and make objects to make it like a pool.
I searched a lot to see if anyone made this possible before or not , the only results was MultiTheftAuto's function :
Код:
createWater(blah blah blah)
And I started making zones with NO COLL objects and set their material as water texture.
then scripted a server sided swiming (and big thanks to SAMP Devs , vectors update (camera rate) updates slowly like +500ms , but it works , no other way (as I know) , and also you can keep holding KEY_AIM , so it sends on foot package faster ) .
NVM , let's go xD
Changelog:
Код:
v2.0 : Fully controllable custom oxygen bar has been added. Added new functions. Fixed under water swim move. Optimized swim/move styles. Changed function IsPlayerInWaterEx to IsPlayerInCustomWater. Added a simple example script in github. v1.1 : Added 4 types of water you can create with CreateWater v1.0 (can be used without any bugs , fixed jumping issue) Fixed jumping issue with addin invisible object. Added 2 new parameter to CreateWater as world and interior. v0.2 : Added new function , DestroyWater(waterid); Removed YSI(y_hook) New optimizations (removing some loops and using extraid) Unlimited water objects ! (create big waters as much as you want !) v0.1 : Released.
New version video including oxygen bar feature:
******* Video
Old Versions :
Click
Click On Meh -_-
PS : the music is lit I already know . LOL xD
Functions:
PHP код:
CreateWater(minx , miny , maxx , maxy , z , depth , world=-1 , interior=-1 , type=WATER_TYPE_NORMAL);
// Creates Water
// parameters : minx/y and maxx/y just works like making zones , z for water Z cord. and depth for its depth/height , world and interior for Virtual world and interiors , type for 4 water types
DestroyWater(waterid);
// returns 0 if ID is not available , returns 1 if it can destory water
IsPlayerInCustomWater(playerid);
// return 1 if player is in water and return 0 if not
IsPlayerUnderCustomWater(playerid);
// return 1 if player is under water and return 0 if not
GetPlayerWaterID(playerid);
// returns player's water ID which is swiming in it
GetWaterDepth(waterid);
// returns water's depth
GetPlayerSwimStyle(playerid);
// returns player's swiming style (only works with custom waters)
GetPlayerCustomOxygen(playerid);
// returns current oxygen value of player as a float variable
SetPlayerCustomOxygen(playerid, Float:ox_value);
// sets player's oxygen value
ShowCustomOxygenBarForPlayer(playerid);
// shows player's custom oxygen bar
HideCustomOxygenBarForPlayer(playerid);
// hides player's custom oxygen bar
PHP код:
public OnPlayerEnterWater(playerid , waterid)
public OnPlayerLeaveWater(playerid , waterid)
// they'll be called when player enters/leaves water
PHP код:
enum
{
WATER_TYPE_LIGHT,
WATER_TYPE_NORMAL,
WATER_TYPE_DARK,
WATER_TYPE_CLOUDY
}
PHP код:
enum
{
SWIM_STYLE_IDLE_ON_WATER,
SWIM_STYLE_MOVE_ON_WATER,
SWIM_STYLE_DIVE_UNDER_WATER,
SWIM_STYLE_MOVE_UNDER_WATER,
SWIM_STYLE_COMING_UP,
SWIM_STYLE_MOVE_FAST_ON_WATER,
SWIM_STYLE_INVALID
}
Streamer - Plugin Thread > https://sampforum.blast.hk/showthread.php?tid=102865
Download:
Github link
Credits:
Incognito - for Streamer Plugin
Bugs and Ideas:
feel free to share you ideas and report bugs here !