SA-MP Forums Archive
[Include] vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc. - 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] vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc. (/showthread.php?tid=642022)

Pages: 1 2


vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc. - RIDE2DAY - 23.09.2017

vSync v0.03


[*] Introduction
Hello, as some of you know, I'm working on a racing gamemode so I've been working with vehicle functions a little bit. I came out with this small include, it syncs random colors, fixes some bugs but also adds some new features. I know this isn't a big deal, usually I share my small scripts. I might say I wrote this from scratch according to my needs, but many thanks to MP2 because this include is based on vFunc and I used some colors data I found there. Over time I added new things and bug fixes and it turned into what it is.


[*] Videos

[*] Bug fixes [*] New features [*] Download
Get your ALS or YSI version now from GitHub!

If you don't know what YSI is or if you're not using it, just get the ALS one. The YSI version uses y_bit, y_hooks and y_iterate. Include this script after Incognito's Streamer if you're using it, that way the neon objects will be streamed objects instead of standard ones.


[*] Documentation
Feel free to check the documentation in order to know how the new functions work, make sure you don't miss the Notes section.


[*] Other
Thank you for reading my thread, if you want to support what I do you might buy me a coffe! Join to my Discord server if you want to follow the development of my gamemode.

If you find any bug, please let me know.

Best regards.


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - Crystallize - 23.09.2017

Useful and not useful
3 stars you could improve it with new funcs etc


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - Spmn - 23.09.2017

I suggest you to change vSync_gVehDefaultColors structure to:
Code:
{ number_of_colors, color1, color2 ... }
So you won't have to loop through all colors everytime when -1 is passed to CreateVehicle and equivalents

Code:
new rand_col = 1 + random(vSync_gVehDefaultColors[modelid - 400][0]);



Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - DonaldDuck - 23.09.2017

another awesome release.


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - crukk11 - 26.09.2017

this include is pre-built.


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - PT - 27.09.2017

Nice work I like to see what you are doing nice work

+rep11


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - cuber - 27.09.2017

Well done, R2D.


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - Zeth - 21.10.2017

Now I am gonna ride 2 day in my server with this new include. +Rep


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - Widoh - 07.11.2017

Really liked it, another amazing script


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - Kar - 07.11.2017

are you sure 1123 and 1125 are front bullbars?

I swear they were rear


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - RIDE2DAY - 07.11.2017

Quote:
Originally Posted by Kar
Посмотреть сообщение
are you sure 1123 and 1125 are front bullbars?

I swear they were rear
Nice find, yes, 1125 affects the back side also. Even so, Remington's bullbars use the same "GTA slot", so we can't use two of those three components (1100, 1123, 1125) at once. For example, if 1125 is installed and we add 1100 the 1125 one would be removed automatically, that's just how GTA works.

In my opinion, in terms of programming, it wouldn't make too much sense to add 1125 to both slots (front and rear) because they would store the same component. And the rear slot should be cleared also whenever the front fullbar changes, just unuseful code in my opinion.


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - Gammix - 07.11.2017

GetVehicleWeihht should be GetVehicleMass because weight is dynamic (mass + passengers weight).

Quote:

from samp wiki (OnVehicleRespray)

Watch out, the name is ambiguous, Pay 'n' Spray shops don't call this callback.

You have to implement a detection method for this, probably under OnPlayerUpdate. I did this in vehicleplus.inc if i am not mistaken.


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - Kar - 07.11.2017

Quote:
Originally Posted by RIDE2DAY
Посмотреть сообщение
Nice find, yes, 1125 affects the back side also. Even so, Remington's bullbars use the same "GTA slot", so we can't use two of those three components (1100, 1123, 1125) at once. For example, if 1125 is installed and we add 1100 the 1125 one would be removed automatically, that's just how GTA works.

In my opinion, in terms of programming, it wouldn't make too much sense to add 1125 to both slots (front and rear) because they would store the same component. And the rear slot should be cleared also whenever the front fullbar changes, just unuseful code in my opinion.
Well we found the issues and sorted it.

Great stuff to know.


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - RIDE2DAY - 07.11.2017

Quote:
Originally Posted by Gammix
Посмотреть сообщение
GetVehicleWeihht should be GetVehicleMass because weight is dynamic (mass + passengers weight).


You have to implement a detection method for this, probably under OnPlayerUpdate. I did this in vehicleplus.inc if i am not mistaken.
You're totally right about the weight issue, I'm going to change it. The funny fact is that I used "mass" as variable name! On the other hand, this include calls OnVehicleRespray when Pay 'n' Spray shops are used and applies random colors also.

Thanks for pointing that out.


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - Gammix - 08.11.2017

Quote:
Originally Posted by RIDE2DAY
Посмотреть сообщение
You're totally right about the weight issue, I'm going to change it. The funny fact is that I used "mass" as variable name! On the other hand, this include calls OnVehicleRespray when Pay 'n' Spray shops are used and applies random colors also.

Thanks for pointing that out.
Oh i see it now, you had the OnPlayerUpdate part for OnVehicleRespray already. I use my phone most of the time when i am at work so yeah, i missed that part lol!


EDIT: Another thing, instead of using "CallLocalFunction", call the function directly in case of custom functions, since defualt samp ones like "OnVehicleRespray" are declared no matter you define them (public) or not.

Example:
PHP код:
// replace this
CallLocalFunction("OnVehicleCreated""i"vehicleid);
// to
#if defined OnVehicleCreated
    
OnVehicleCreated(vehicleid);
#endif
// and for decleration
#if defined OnVehicleCreated
    
forward OnVehicleCreated(vehicleid);
#endif 



Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - rfr - 25.12.2017

wow cool


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - Florin48 - 25.12.2017

Frumoasa melodia din video


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - ~Error - 13.02.2018

There is expression bug in AddVehicleComponent


fix it =)


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - RIDE2DAY - 13.02.2018

@~Error: thank you for reporting that, fixed.


Re: vSync - OnVehicleChangePaintjob, OnVehicleRespray, GetVehicleInterior, GetVehicleNumberPlate, Pay 'n' Spray fix, etc - Verc - 10.06.2018

OnVehicleDestroyed would be nice.