Need Help with /setmoney ZCMD
#1

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.
Reply
#2

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;
    }
}
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)