[Help] Money Rests - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Money Rests (
/showthread.php?tid=266225)
[Help] Money Rests -
akif - 04.07.2011
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!
Re: [Help] Money Rests -
Jack_Leslie - 04.07.2011
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.
Re: [Help] Money Rests -
akif - 04.07.2011
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.ph...=South+african
Please..
Thanks in advance..
Re: [Help] Money Rests -
Jack_Leslie - 04.07.2011
Quote:
Originally Posted by akif
|
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)
Re: [Help] Money Rests -
akif - 04.07.2011
There is something like this, And more with Pcash..
Quote:
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];
}
|
Re: [Help] Money Rests -
Jack_Leslie - 04.07.2011
It looks like you've got stocks that should work..
What's the code for /buycar?
Re: [Help] Money Rests -
akif - 04.07.2011
Thats a FS that i use as Car dealer..
Re: [Help] Money Rests -
Jack_Leslie - 04.07.2011
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
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...
Re: [Help] Money Rests -
=WoR=Varth - 05.07.2011
Do you have anti-cheat?