SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 06/05/2016, 08:51 PM   #1
Telekinetic
Little Clucker
 
Telekinetic's Avatar
 
Join Date: May 2015
Posts: 5
Reputation: 0
Question Infinite oxygen and etc.

I'm not even a scripter, I'm just interested whether it is possible to script infinite oxygen. Knowing it is possible via a-cheat-this-site-won't-let-me-name.
I had an idea of hovering an ability bar textdraw over where oxygen should be, and use GetPlayerAnim equal to the index of the diving one (basically how roleplay servers identify if player is wet or not), and if the animation is positive, set player's health to infinity as long as the anim is active, and the lightblue textdraw will stay untouched as if it never decreased. IDK If this is possible of whatever I said about scripts will even work. I'm not a scripter like I said.

I have another question, is it possible to script walking under water?
I also have an idea of how to make this work and tell me if it will.
Basically, say a player is already somewhere where the swimming animation activates, if he dives, and then presses a button, let's say Action Key (server sided bind triggering the following), and server does GetPlayerCoordinates X,Y,Z to get his location, then do SetPlayerCoordinate X,Y,Z-20 or Z-30 and then again SetPlayerCoordinate X,Y,Z, basically teleporting the player out and in water again to make him fall down and walk around normally.
Will this work? If yes someone help, I've no idea how to script, I can only make theories.
Thanks in advance.
__________________
Telekinetic is offline   Reply With Quote
Old 06/05/2016, 08:57 PM   #2
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,831
Reputation: 114
Default Re: Infinite oxygen and etc.

You can use this include:
http://forum.sa-mp.com/showthread.php?p=3694016
And then use SetPlayerOxygenValue in a short repeating timer or something.
Code:
SetPlayerOxygenValue(playerid, Float:Value);
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 06/05/2016, 09:01 PM   #3
Telekinetic
Little Clucker
 
Telekinetic's Avatar
 
Join Date: May 2015
Posts: 5
Reputation: 0
Default Re: Infinite oxygen and etc.

Quote:
Originally Posted by CalvinC View Post
You can use this include:
http://forum.sa-mp.com/showthread.php?p=3694016
And then use SetPlayerOxygenValue in a short repeating timer or something.
Code:
SetPlayerOxygenValue(playerid, Float:Value);
Can the value be set to infinity, or uh an extremely large value, so the time intervals won't be measured by seconds?
And, what about the walking under water?
Telekinetic is offline   Reply With Quote
Old 06/05/2016, 09:09 PM   #4
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,139
Reputation: 445
Default Re: Infinite oxygen and etc.

Quote:
Originally Posted by Telekinetic View Post
Can the value be set to infinity, or uh an extremely large value, so the time intervals won't be measured by seconds?
And, what about the walking under water?
The include should provide documentation for it's functions, though this uses a "custom" oxygen system. You cannot natively interact with oxygen levels without modifying the data the client sends to the server(and the data the server sends to the client).
Abagail is offline   Reply With Quote
Old 06/05/2016, 09:22 PM   #5
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,918
Reputation: 258
Default Re: Infinite oxygen and etc.

Quote:
Originally Posted by Telekinetic View Post
I'm not even a scripter, I'm just interested whether it is possible to script infinite oxygen. Knowing it is possible via a-cheat-this-site-won't-let-me-name.
I had an idea of hovering an ability bar textdraw over where oxygen should be, and use GetPlayerAnim equal to the index of the diving one (basically how roleplay servers identify if player is wet or not), and if the animation is positive, set player's health to infinity as long as the anim is active, and the lightblue textdraw will stay untouched as if it never decreased. IDK If this is possible of whatever I said about scripts will even work. I'm not a scripter like I said.

I have another question, is it possible to script walking under water?
I also have an idea of how to make this work and tell me if it will.
Basically, say a player is already somewhere where the swimming animation activates, if he dives, and then presses a button, let's say Action Key (server sided bind triggering the following), and server does GetPlayerCoordinates X,Y,Z to get his location, then do SetPlayerCoordinate X,Y,Z-20 or Z-30 and then again SetPlayerCoordinate X,Y,Z, basically teleporting the player out and in water again to make him fall down and walk around normally.
Will this work? If yes someone help, I've no idea how to script, I can only make theories.
Thanks in advance.
There is no native function which can modify or something like that for the oxygen like Abagail said.
And for walk in the water, I don't think it's possible. Why? When someone is in the water, he constantly uses animations and walking are animations too. The best you can do are clean animations every 0.1 sec (?) and put walk animation. Seems like glitches walk.
I hope I helped you.
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 06/05/2016, 09:33 PM   #6
PrO.GameR
Gangsta
 
PrO.GameR's Avatar
 
Join Date: Oct 2012
Posts: 694
Reputation: 121
Default Re: Infinite oxygen and etc.

As pretty much everyone here said there is no native function to interact with it, however I believe SKY plugin lets you do that, hence the include provided by Calvin.

About walking under water, there is a rule in GTA SA which is if you don't enter the water from surface(falling into the water etc.) floating rules don't apply to you, so you can 'walk' under water therefore you could just take the player out and in again below the surface and player can walk, however there are some weird visual effects.
oh btw are you the Telekinetic on supernatural RP servers?
__________________
Blueberry Prison Roleplay will be back soon!
Follow the forums for more information about opening day.

Forums
PrO.GameR is offline   Reply With Quote
Old 06/05/2016, 09:47 PM   #7
Telekinetic
Little Clucker
 
Telekinetic's Avatar
 
Join Date: May 2015
Posts: 5
Reputation: 0
Default Re: Infinite oxygen and etc.

Quote:
Originally Posted by PrO.GameR View Post
As pretty much everyone here said there is no native function to interact with it, however I believe SKY plugin lets you do that, hence the include provided by Calvin.

About walking under water, there is a rule in GTA SA which is if you don't enter the water from surface(falling into the water etc.) floating rules don't apply to you, so you can 'walk' under water therefore you could just take the player out and in again below the surface and player can walk, however there are some weird visual effects.
oh btw are you the Telekinetic on supernatural RP servers?
So I was corrected about the coordinate thing, and yes, that'd absolutely be me. Who are you?
__________________
Telekinetic is offline   Reply With Quote
Old 06/05/2016, 09:50 PM   #8
Ivan_Ino
Big Clucker
 
Join Date: Oct 2012
Location: Croatia
Posts: 101
Reputation: 120
Default Re: Infinite oxygen and etc.

well.. i made this maybe this can help you..

http://forum.sa-mp.com/showthread.php?t=606323
Ivan_Ino is offline   Reply With Quote
Old 06/05/2016, 09:53 PM   #9
Telekinetic
Little Clucker
 
Telekinetic's Avatar
 
Join Date: May 2015
Posts: 5
Reputation: 0
Default Re: Infinite oxygen and etc.

Quote:
Originally Posted by Ivan_Ino View Post
well.. i made this maybe this can help you..

http://forum.sa-mp.com/showthread.php?t=606323
Yep. I saw that. Thank you, and anyone who responded to this thread with help.

P.S Pro, who are you?
__________________
Telekinetic is offline   Reply With Quote
Old 06/05/2016, 10:09 PM   #10
Ivan_Ino
Big Clucker
 
Join Date: Oct 2012
Location: Croatia
Posts: 101
Reputation: 120
Default Re: Infinite oxygen and etc.

Quote:
Originally Posted by Telekinetic View Post
Can the value be set to infinity, or uh an extremely large value, so the time intervals won't be measured by seconds?
And, what about the walking under water?
Well.. you can set SetPlayerMaxOxygenValue(playerid, 5000.0); so that is x50 than default, so u can be under water too long..

about walking under water, that anyway will be detected like under water, dont worry
Ivan_Ino is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Oxygen Controller (Control player oxygen status) Ivan_Ino Includes 40 24/10/2016 05:31 PM
Oxygen help :) NeStOr95 Scripting Help 5 06/08/2014 11:54 PM
[FilterScript] Oxygen Cylinder TreePuncher Filterscripts 11 08/11/2012 08:38 PM
Any way to get oxygen level? Baboon Scripting Help 4 16/03/2012 11:39 PM
Oxygen Roleplay - Help Mr.Fames Server Support 6 10/11/2011 06:38 AM


All times are GMT. The time now is 10:47 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.