PDA

View Full Version : [Help] Money Rests


akif
04/07/2011, 12:35 AM
Hi guys, I got a problem that when ever i add any car dealers and when i /buycar it gives my money back, And i've tried it on other GM it doesn't give the money Back Please help me! :(

Jack_Leslie
04/07/2011, 12:54 AM
Because your GameMode has user files and uses a variable for the money, so you have to find that.

Example:

PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-carcost;


Using:

GivePlayerMoney(playerid, Money);


Always resets if you're GameMode has a user file system with money OR you have a Public command that automatically does it for you, which obviously you do not.

akif
04/07/2011, 01:04 AM
Hey can you please check this game mod and please say me where is it? Because i din't get you http://forum.sa-mp.com/showthread.php?t=191704&highlight=South+african

Please..

Thanks in advance..

Jack_Leslie
04/07/2011, 01:06 AM
Hey can you please check this game mod and please say me where is it? Because i din't get you http://forum.sa-mp.com/showthread.php?t=191704&highlight=South+african

Please..

Thanks in advance..

Not sure, look for a command that's already in the game that buys something.

Or search for something like:
pMoney
pCash
PlayerInfo[playerid](Money/cash here)

akif
04/07/2011, 01:08 AM
There is something like this, And more with Pcash..

stock GivePlayerCash(playerid, money)
{
PlayerInfo[playerid][pCash] -= money;
ResetMoneyBar(playerid);
UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);
return PlayerInfo[playerid][pCash];
}

stock SetPlayerCash(playerid, money)
{
PlayerInfo[playerid][pCash] = money;
ResetMoneyBar(playerid);
UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);
return PlayerInfo[playerid][pCash];
}

stock ResetPlayerCash(playerid)
{
PlayerInfo[playerid][pCash] = 0;
ResetMoneyBar(playerid);
UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);
return PlayerInfo[playerid][pCash];
}

stock GetPlayerCash(playerid)
{
return PlayerInfo[playerid][pCash];
}

Jack_Leslie
04/07/2011, 01:11 AM
It looks like you've got stocks that should work..

What's the code for /buycar?

akif
04/07/2011, 01:13 AM
Thats a FS that i use as Car dealer..

Jack_Leslie
04/07/2011, 01:15 AM
Those kind of FilterScripts don't really work due to the use of Files. It'd only work if you were experienced enough to edit the FS to work with the user files or put the FS into the actual GameMode. My advice is to find someone to combine the FS into the GameMode or code a custom Dealership.

akif
04/07/2011, 01:22 AM
But the FS when i use in other GM it works perfect i mean it dont give money back...

I din't get you what are you saying...

=WoR=Varth
05/07/2011, 02:09 AM
Do you have anti-cheat?

akif
05/07/2011, 03:09 AM
Yea when i tried modS0biet money hack on my server,Nothing happend

=WoR=Varth
05/07/2011, 03:21 AM
Then you have to set up the variable for the money.
Sorry I can't help you in MSN atm, I'm going off in 10 minutes.

akif
05/07/2011, 03:22 AM
How to set it up?

=WoR=Varth
05/07/2011, 03:26 AM
PM me your anti money cheat (Or you don't know where is it? -.-)
The anti-cheat set the money in to variable or people call it server-side money.
f.e P_Data[playerid][Money] -= 1000 will decrease the playerid money 1000. Remember that's an example, Idk what variable you use in your anti-cheat.
If you get mad with it then just delete the anti-cheat and make it by your self.

akif
31/08/2011, 03:34 AM
Well after a long time,I forgot about this,Yes i removed the anti-cheat and when i bought a car from dealers my money was gone and after some times the money comes back and i tried /buycar again it said you dont have money..

=WoR=Varth
31/08/2011, 08:00 AM
Show us your /buycar command.