SA-MP Forums Archive
[Include] Oxygen Controller (Control player oxygen status) - 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] Oxygen Controller (Control player oxygen status) (/showthread.php?tid=606323)

Pages: 1 2


Re: Oxygen Controller (Control player oxygen status) - Ivan_Ino - 07.05.2016

Quote:
Originally Posted by Mark_Samp
View Post
I just added
Code:
#include <OxygenController>
without any further changes but when I tried to compile?
Code:
pawno\include\progress2.inc(434) : error 017: undefined symbol "playerid"
Although My script didn't even reach 434 Code Line.
Did you modified anything in include file Oxygen / Progress?
and try download last version of progress inc, cuz i don't have that problem..

EDIT: Line 434 in progress2.inc change to, try that..
Quote:

DestroyAllPlayerProgressBars(i);




Re: Oxygen Controller (Control player oxygen status) - vannesenn - 07.05.2016

How did you do that? It's amazing bro! Only suggestion is - replace for with foreach in _oxygen_timer. Also You should replace OnPlayerUpdate with timer(eg. 250 ms). It's not like OnPlayerUpdate, but it's better than OPU. And, these functions like GetPlayerMaxOxygenValue you can replace with macro definition

Код:
#define GetPlayerMaxOxygenValue(%0) \
    s_max[%0]
@ Ako me nisi razumio. U timeru "_oxygen_timer" zamijeni for petlju s foreachom. Također mislim da bi trebao sav kod u OnPlayerUpdateu staviti u neki timer koji će se vrtiti svakih 200-250 ms. Neće biti precizno kao OPU, ali će manje derati resurse. Funkcije kao љto je GetPlayerMaxOxygenValue moћeљ zamijeniti s macro definicijama. Macro definicije su kao nekakve varijable u compileru, tokom kompajlanja compiler će zamijeniti GetPlayerMaxOxygenValue(%0) s s_max[%0] gdje je %0 parametar koji upiљeљ(tipa playerid). Sve u svemu, svaka čast, ћao mi je samo љto je to netko napravio prije nego љto je SA-MP dobio takvo љto. Ћalosno al ajd. Rep++


Re: Oxygen Controller (Control player oxygen status) - Ivan_Ino - 07.05.2016

Thanks man, i know whats macros xD , that about times is pretty good suggestion which i will implement in next update, macros aswell..

Hvala ti, znam sto su macro definicije naravno, to o timeru je dobro, ubacim to u sljedecem updateu kao i macrose.. p.s. drago mi je sresti nase ljude tu xDD


Re: Oxygen Controller (Control player oxygen status) - vannesenn - 08.05.2016

Also, you should do code better. Eg. this can be better - static OxygenInit(playerid). Create playertextdraw on player connect, not on server boot.


Re: Oxygen Controller (Control player oxygen status) - iSteve - 08.05.2016

Good work, really liked it.
+rep for this


Re: Oxygen Controller (Control player oxygen status) - TheProblem - 08.05.2016

Good job!


Re: Oxygen Controller (Control player oxygen status) - Ivan_Ino - 08.05.2016

Thanks guys, also, mini update..

VVWVV send me new commit on github with foreach support..

now, if you want use foreach add line
Код:
#define _foreach
BEFORE

Код:
#include <OxygenController>



Re: Oxygen Controller (Control player oxygen status) - VVWVV - 08.05.2016

Quote:
Originally Posted by Ivan_Ino
Посмотреть сообщение
Thanks guys, also, mini update..

VVWVV send me new commit on github with foreach support..

now, if you want use foreach add line
Код:
#define _foreach
BEFORE

Код:
#include <OxygenController>
Yes!
I made the code more optimized and readable.


Re: Oxygen Controller (Control player oxygen status) - n0minal - 08.05.2016

Very impressive Ino, I really loved this include, I'll surely use it if I someday resume my project.

+7 from your friend n0minal


Re: Oxygen Controller (Control player oxygen status) - Ivan_Ino - 08.05.2016

Quote:
Originally Posted by ipsLeon
Посмотреть сообщение
Very impressive Ino, I really loved this include, I'll surely use it if I someday resume my project.

+7 from your friend n0minal
Thank you my friend.. i hope u will enjoy using it..


Re: Oxygen Controller (Control player oxygen status) - n0minal - 09.05.2016

Just a little question: The oxygen is only used to dive? I thought that GTA's stamina and oxygen were the same thing lmao.


Re: Oxygen Controller (Control player oxygen status) - GhostHacker - 09.05.2016

Quote:
Originally Posted by ipsLeon
Посмотреть сообщение
Just a little question: The oxygen is only used to dive? I thought that GTA's stamina and oxygen were the same thing lmao.
Oh god...


Re: Oxygen Controller (Control player oxygen status) - n0minal - 09.05.2016

Quote:
Originally Posted by GhostHacker
Посмотреть сообщение
Oh god...
Yeah sorry for the dumb question, that's why I shouldn't be awake at 2AM posting shits


Re: Oxygen Controller (Control player oxygen status) - Ivan_Ino - 11.05.2016

Update 2.0

- Out of beta, stable version
- Fixed some bugs
- Added new function GetPlayerDepth(playerid); (returning Float value)
- Precised giving / taking oxygen value

New function is implement in example script, which you can found on git ->
https://github.com/Ino42O/OxygenController

-> example script
https://github.com/Ino42O/OxygenCont...genExample.pwn


Re: Oxygen Controller (Control player oxygen status) - RogerCosta - 11.05.2016

Great script, Ivan!

5 stars.


Re: Oxygen Controller (Control player oxygen status) - RogerCosta - 11.05.2016

Great script, Ivan!

5 stars.


Re: Oxygen Controller (Control player oxygen status) - Ivan_Ino - 13.05.2016

Thanks man


Re: Oxygen Controller (Control player oxygen status) - ax1 - 15.05.2016

edit : everythings ok, i just had to download latest colandreas plugin versoion


Re: Oxygen Controller (Control player oxygen status) - ax1 - 16.05.2016

Код:
[20:53:56] [debug] Run time error 19: "File or function is not found"
[20:53:56] [debug]  SetFakeHealth
[20:53:56] [debug]  SendLastSyncData
[20:53:56] [debug] Run time error 19: "File or function is not found"
[20:53:56] [debug]  SetFakeHealth
[20:53:56] [debug]  SendLastSyncData
[20:53:56] Script[gamemodes/gaixd.amx]: Run time error 19: "File or function is not found"



Re: Oxygen Controller (Control player oxygen status) - Ivan_Ino - 16.05.2016

Quote:
Originally Posted by ax1
Посмотреть сообщение
Код:
[20:53:56] [debug] Run time error 19: "File or function is not found"
[20:53:56] [debug]  SetFakeHealth
[20:53:56] [debug]  SendLastSyncData
[20:53:56] [debug] Run time error 19: "File or function is not found"
[20:53:56] [debug]  SetFakeHealth
[20:53:56] [debug]  SendLastSyncData
[20:53:56] Script[gamemodes/gaixd.amx]: Run time error 19: "File or function is not found"
Update SKY plugin, also don't forget put SKY (linux 'SKY.so') into your server.cfg file