[Include] OnVehicleRespray for pay 'n' spray
#1

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.
Reply
#2

Good, I guess?
Reply
#3

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

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 ?
Reply
#5

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

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

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.
Reply
#8

preety much usefull all around SAMP =)
Reply
#9

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

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.
Reply
#11

WRONG THREAD
Reply
#12

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...
Reply
#13

WRONG THREAD SORRY.
Reply
#14

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)