Money help please - 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: Money help please (
/showthread.php?tid=419495)
Money help please -
Camorra - 01.03.2013
Hi
i trying make some dialog when player have X ammot of point so he can buy cash with that.
but that not giving the money, i made whole system with that " rewards " aka points, player car buy cars and more few things and rest works, just that money part not working,
Well this is the code of cash
pawn Код:
if(PlayerInfo[playerid][pRewards]<34) return SendClientError(playerid,"Not enough rewards");
{
new camorra[128];
new amount = 2500000;
PlayerInfo[playerid][pRewards] = PlayerInfo[playerid][pRewards]-35;
dini_IntSet(PlayerInfo[playerid],"rewards",PlayerInfo[playerid][pRewards]);
SendClientMessage(playerid, COLOR_WHITE,"-------------------------");
format(camorra, sizeof(camorra), "{e94a4a}[info:]{f1a3a4} You have received {003300}%d $ ", amount);
SendClientMessage(playerid, COLOR_RED, camorra);
SendClientMessage(playerid, COLOR_WHITE,"-------------------------");
GivePlayerMoneyEx(playerid, 2500000);
//GivePlayerMoneyEx(playerid, amount); also tryed with that
}
return 1;
Re: Money help please -
[MG]Dimi - 01.03.2013
Show us
pawn Код:
stock GivePlayerMoneyEx(playerid, amount)
Re: Money help please -
Denying - 01.03.2013
What are you using to save data such as player's money? Instead of using the GivePlayerMoneyEx just load the player's money on a variable let's say called "Money" and use
SetPlayerMoney(playerid, strval(Money)+amount);
or
GivePlayerMoney(playerid, amount);
Re: Money help please -
Camorra - 01.03.2013
This one part of " Rewards " this things works but the buytable not works.
pawn Код:
if(PlayerInfo[i][pRewards]==10)
{
new camorrastring[128];
new amount = 150000;
format(camorrastring, sizeof(camorrastring), "{e94a4a}[info:]{f1a3a4} You have received {003300}$%d Reward", amount);
SendClientMessage(i, COLOR_RED, camorrastring);
GivePlayerMoneyEx(i,amount);
}