How to check if a specific vehicleid is getting damaged
#1

Hey guys,
I was wondering if there is a way to check if a specific vehicle id is getting damaged.
I am trying to check a specific one because I am not comfy with calling the public onVehicleDamageStatusUpdate
each and every time someone gets damaged with his vehicle. for example:
PHP код:
public OnVehicleDamageStatusUpdate(vehicleidplayerid)
{
    if(
vehicleid VID)//VID = Specific Vehicle ID
    
{
          
RepairVehicle(vid);
    }
    return 
1;

That will call the public so many times and I assume will cause major lags.
So there is any way to check damage for a specific Car?
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
Let me sumarise your question:

How can I detect a change in a vehicle, without using the code designed to detect changes in vehicles?

See the issue? Why would there be another way, and even if there is another way what makes you think it will be better than the native way?
I am just saying... it seems the native way (that is more easier) is going to lag my server so much.
but I don't mind using the easier native way =)
Thanks mate.
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
Have you tested it to see if it does lag? And did it not occur to you that other ways might lag too?

I've seen quite a lot of these "I think this will lag, but haven't made any effort to prove my hypothesis, please give me another method I can use and just assume won't lag with the same lack of evidence" posts, and they honestly make no sense!
When you have a server with 250 players each and everyday, and tons of pawn codes in your mode, you want to make the mode more efficient, because every call of any public is more ram usage.

BTW, if there is a way to check if a specific vehicle is getting damaged instead checking each and every car in the mode, I can assure to you, it will be more efficient and more "server friendly".
Reply
#4

OnVehicleDamageStatus really isn't called that often. I think you're confused with OnUnoccupiedVehicleUpdate.
Reply
#5

you just don't get it...

this callback is called only when some specific vehicle get damaged...
the variable "vehicleid" is for that specific vehicle only...
it doesn't repair all vehicles

pawn Код:
if(vehicleid = VID)//VID = Specific Vehicle ID
I just can't understand what you did there...
this callback is called only for the specific vehicle ID, so there is no need for that variable
also , you forgot to declare the variable :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)