Taking money when tuning vehicle -
Ceez - 24.06.2013
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!
Re: Taking money when tuning vehicle -
Josh_Main - 24.06.2013
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
Re: Taking money when tuning vehicle -
Ceez - 24.06.2013
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.
Re: Taking money when tuning vehicle -
Niko_boy - 24.06.2013
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 )
Re: Taking money when tuning vehicle -
Ceez - 24.06.2013
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.
Re: Taking money when tuning vehicle -
Ceez - 25.06.2013
Anybody. .?
Re: Taking money when tuning vehicle -
introzen - 25.06.2013
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.
Re: Taking money when tuning vehicle -
Ceez - 25.06.2013
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
Re: Taking money when tuning vehicle -
Maxips2 - 25.06.2013
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.