Taking money when tuning vehicle
#1

Hey,
I have an Anti-Cheat for Money Hacks which restricts my Tuning Garages from taking money from players when tuning the vehicle.
We're a roleplay server that is working on an economy, and vehicle parts cost a few in real.
Anybody knows how do I make the Loco Low's, San Fierro Arch Angels etc take money away from the player on tuning?
The original vehicle part price.
Thanks!
Reply
#2

Ignore what I just wrote, try this. I'm not completely sure though.


Код:
public OnVehicleMod(playerid, vehicleid, componentid)
{
        GivePlayerMoney(playerid -x);
	return 1;
}
Change the "x" to the amount you want taken
Reply
#3

Not that, thanks anyway though.
This would take the same amount of money for every single tune, right?
example: I Chose a front chrome bumper - it will take 1500$,
I choose a rim, it takes 1500$, i choose an exhaust, it takes 1500$.
I Want to find an option that takes default GTA Prices.
Reply
#4

u can create some checks
pawn Код:
if( componentid == sayNosID ) GivePlayerMoney(playerid -x);
else if( componentid == sayRimID ) GivePlayerMoney(playerid -y);
this can be made better using array or a switch statement ( or a stock )
Reply
#5

Not possible though,
thinking forward when the player's car respawns, it re-adds the tunes. will fee him again for the upgrades!
Any more ideas? it'll be highly appreciated.
Reply
#6

Anybody. .?
Reply
#7

You just have to store it. Just like you do with your account system. Which I'm pretty sure you have if you're a Roleplay server.

At my server, I had a folder called players, where I stored every player's stats inside a .int file named after the player.

e.g. Peter_Johnson.ini Albert_Einstein.ini...

So if you would like to save the car parts, First you'd have to make a car ownership script, which basically enables players to buy their cars and spawn them whenever they want, or (if you choose to) spawn them on gamemodeinit.

If this already would be scripted, you would have a file or a database including every information point on the car. E.g.
Код:
Model=522
Owner=Peter_Johnson
Color1=2
Color2=222
SpawnX=0.000
SpawnY=0.000
SpawnZ=0.000
SpawnA=0.000

and so on...
Here you have to add E.g.

Код:
Mod1=
Mod2=
Mod3=
Mod4=

and so on.
Then whenever a player mods his car, save it to the database/file and restore it on next vehicle spawn.

Hope you learned something. Tell me if you need anymore help.
Reply
#8

what? lol
I already have this, Read the request man, I wanted a system that TAKES MONEY from player WHEN HE TUNES IT at the garage lol thanks for the effort anyway
Reply
#9

Quote:
Originally Posted by Ceez
Посмотреть сообщение
Not possible though,
thinking forward when the player's car respawns, it re-adds the tunes. will fee him again for the upgrades!
Any more ideas? it'll be highly appreciated.
Then use a variable to determine wether it should take money or not.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)