Posts: 6,242
Threads: 8
Joined: Jun 2008
Quote:
Originally Posted by CloW
Код:
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
SafeGivePlayerMoney(playerid, -500);
return 1;
}
When you select paintjob server take 500 $ from you,if you cancel buying server take more 500$ from you.
|
Yea, that's gonna be a bug, but more bug with your code.
Make a check to check if it was applied or not, and THEN charge them if it's changed.
It's changing the paintjob on the car for the preview, which is what the callback is picking up. Your code is simply taking 500 each change that it makes.
Posts: 6,242
Threads: 8
Joined: Jun 2008
13.07.2015, 00:28
(
Последний раз редактировалось Sew_Sumi; 13.07.2015 в 01:12.
)
Could do a check, that it checks when you change the paintjob, but only charges you once you leave if you have enough money. (You'd also need to see if you can find a way of checking the paintjob though maybe.
https://sampwiki.blast.hk/wiki/OnVehiclePaintjob Returns the paintjobid.
https://sampwiki.blast.hk/wiki/OnEnterExitModShop Calls when the vehicle enters and exits.
Like, a new variable
, and when they exit the mod shop then they get charged. The distance they go from the interior to the exterior should be enough to trigger the payments needed.
When the player exits out of the mod shop not modding it, the paintjob will go back to the original, so a
Код:
CarPaintjob [vehicleid] = paintjobid;
could be an option to track this.
You will need to monitor fenders,skirts,roofmods, NOS, Hydraulics as well though to make it encompassing of all of the features offered in that store.