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.