SA-MP Forums Archive
Need Help with /setmoney ZCMD - 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: Need Help with /setmoney ZCMD (/showthread.php?tid=396802)



Need Help with /setmoney ZCMD - darkvsoul36 - 02.12.2012

Hello again! I am trying to make a /setmoney command using ZCMD. Currently, I have:

Код:
CMD:setmoney(playerid, params[])
{
	new target;
	new money;
	if(sscanf(params, "ui", target, money)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setmoney [playerid] [amount]");
	{
		GivePlayerMoney(target, money);
		return 1;
	}
}
At the moment, all that it does is give the player a certain amount of money. So if the player had 100 dollars, and I used the command /setmoney [playerid] 200, it would leave the player with 300 dollars. I would like to type in "/setmoney [playerid] 200" and it would set the player's money to 200, no matter what the initial value. Could someone help me with this? From what I checked in my Pawno.exe there is no SetPlayerMoney function. Help would be appreciated. Thank you in advance.


Re: Need Help with /setmoney ZCMD - [HK]Ryder[AN] - 02.12.2012

pawn Код:
CMD:setmoney(playerid, params[])
{
    new target;
    new money;
    if(sscanf(params, "ui", target, money)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setmoney [playerid] [amount]");
    {
        ResetPlayerMoney(target);
        GivePlayerMoney(target, money);
        return 1;
    }
}



Re: Need Help with /setmoney ZCMD - darkvsoul36 - 02.12.2012

Oh, duh. Thank you. I was over-thinking it.