Transfender/PayNSpray server-sided money.
#1

Is it possible to make transfender/paynspray take money from the players when they use it.

Im using GivePlayerOLMoney, not GivePlayerMoney and since paynspray and transfender use GivePlayerMoney, once the player respray/mod/repair their vehicle, the server is returning the money back to the player.
Reply
#2

No.

To circumvent this, you can allow for players to lose money, but not gain it. This way, users will still pay for transfenders, but not gain any from casinos or parking meters.
Reply
#3

You could actually check if the player has fixed his vehicle by setting all vehicles spawned their health to 999 (health cant increase unless fixed by command/paynspray), create a repeating timer with a 1 second (or less) interval and check the vehicle health. Then if vehicle health reached 1000 set it back to 999 and remove the cash from player
Reply
#4

Quote:
Originally Posted by Macluawn
Посмотреть сообщение
No.

To circumvent this, you can allow for players to lose money, but not gain it. This way, users will still pay for transfenders, but not gain any from casinos or parking meters.
Thats the question, how to make them LOSE money when fixing/tuning x) ?
Reply
#5

Well you can use the OnVehicleMod callback for Transfender/Wheels Arch Angels etc.
Take note that this callback can also be used by cheaters, so make sure you check if they are in a valid modding location or make sure the callbacks are legitimate. The callback https://sampwiki.blast.hk/wiki/OnEnterExitModShop may also prove useful here.

As for the pay 'n' spray, the only thing you can really do is constantly check the vehicle's health as suggested above, then check to see if they're near a pay 'n' spray and take the money from them. I would add some sort of variable to say that they have already paid for the pay 'n' spray, just in case there is a delay between the client and server and their vehicle still manages to have the same health.
Reply
#6

check https://sampwiki.blast.hk/wiki/OnVehicleRespray out.

Also, check the pastebin link there, and then do something like:

PHP код:
public OnVehicleRespray(playeridvehicleidcolor1color2)
{
    if(
GetPlayerInterior(playerid) == 0GivePlayerOLMoney(playerid, -100);
    return 
1;

Reply
#7

I was thinking of the same thing yesterday. I'll try to do it following this:
http://forum.sa-mp.com/showpost.php?...57&postcount=2
Thanks to Konstantinos.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)