SA-MP Forums Archive
[Include] OnVehicleRespray for pay 'n' spray - 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] OnVehicleRespray for pay 'n' spray (/showthread.php?tid=360865)



OnVehicleRespray for pay 'n' spray - MP2 - 19.07.2012

Makes OnVehicleRespray be called when a player uses pay 'n' spray.

DOWNLOAD
http://pastebin.com/zX96D4dA

Works by setting vehicles' health to 999 when created and detecting an increase to 1000.

Simples.

NOTE: 'color1' and 'color2' values will always be -1 in OnVehicleRespray.


Re: OnVehicleRespray for pay 'n' spray - FireCat - 19.07.2012

Good, I guess?


Re: OnVehicleRespray for pay 'n' spray - Vince - 19.07.2012

Requires Y_Hooks .. Not very user friendly for those who decide not to use that.


Re: OnVehicleRespray for pay 'n' spray - Glint - 19.07.2012

Quote:

Works by setting vehicles' health to 999 when created and detecting an increase to 1000

i didn't get that part ?

does that mean it is going to work if an admin used "/fix [playerid]" to fix the specified player's vehicle ?


Re: OnVehicleRespray for pay 'n' spray - Kyle - 19.07.2012

You should make it call for when it's resprayed in transfender etc.


Re: OnVehicleRespray for pay 'n' spray - Hanger - 19.07.2012

Have you heard about vehicle health hack? Hackers may spam health hack therefore server will be lagged.


Re: OnVehicleRespray for pay 'n' spray - MP2 - 19.07.2012

Quote:
Originally Posted by FireCat
Посмотреть сообщение
Good, I guess?
You guess correct.

Quote:
Originally Posted by Vince
Посмотреть сообщение
Requires Y_Hooks .. Not very user friendly for those who decide not to use that.
I agree, I may change it.

Quote:
Originally Posted by Lexi'
Посмотреть сообщение
i didn't get that part ?

does that mean it is going to work if an admin used "/fix [playerid]" to fix the specified player's vehicle ?
If you set a vehicle's health to 1000 it will just set it back to 999. It only calls it if you are in range of a pay 'n' spray for this very reason.

Quote:
Originally Posted by KyleSmith
Посмотреть сообщение
You should make it call for when it's resprayed in transfender etc.
It already is natively - this makes it work for pay 'n' spray also.

Quote:
Originally Posted by Hanger
Посмотреть сообщение
Have you heard about vehicle health hack? Hackers may spam health hack therefore server will be lagged.
Then ban them. This actually makes it a lot easier to detect that hack.


Re: OnVehicleRespray for pay 'n' spray - Niko_boy - 19.07.2012

preety much usefull all around SAMP =)


Respuesta: OnVehicleRespray for pay 'n' spray - CaptainMactavish - 20.07.2012

So you used this in OnPlayerUpdate being conscious that this callback is called around 30 times per second and per player?


Re: Respuesta: OnVehicleRespray for pay 'n' spray - MP2 - 20.07.2012

Quote:
Originally Posted by CaptainMactavish
Посмотреть сообщение
So you used this in OnPlayerUpdate being conscious that this callback is called around 30 times per second and per player?
All it does is check vehicle health - it's not 'damaging'. It's probably more efficient than a timer and loop.

People have it drilled in to their heads that using OnPlayerUpdate is BAD. It's not. Having a loop through 2000 vehicles in there is bad yes, but a single statement is not. It was added to be used, not to just sit there un-used. People complain when they use memory, and when they use CPU, but they're there to be used. I'm not saying efficiency is bad, I just think people go over the top.


Re: OnVehicleRespray for pay 'n' spray - Kyle - 28.07.2012

WRONG THREAD


Re: OnVehicleRespray for pay 'n' spray - FireCat - 28.07.2012

MP2:
Use CallLocalFunction as you're using it as an include.
I guess if you use CallRemoveFunction and you're not using the callback it will give you a warning that you're not using the callback...


Re: OnVehicleRespray for pay 'n' spray - Kyle - 29.07.2012

WRONG THREAD SORRY.


Re: OnVehicleRespray for pay 'n' spray - MP2 - 30.07.2012

Quote:
Originally Posted by FireCat
Посмотреть сообщение
MP2:
Use CallLocalFunction as you're using it as an include.
I guess if you use CallRemoveFunction and you're not using the callback it will give you a warning that you're not using the callback...
Well, the idea is you only include it once (in your GM) so you don't waste memory/cpu. But yes you're right about it not being forwarded.