givecash command not working
#1

The givecash that I'm using for my server doesn't work, when I try to send someone money, no matter how much it doesn't send them it, and it says "You have sent blablabla $0"

Here's the code..
Код:
dcmd_givecash(playerid,params[])
{
	new
		giveplayerid,
		amount;
	if (sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, COLOR_WHITE, "Usage: /givecash [id] [amount]");
	else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid ID!");
	else if (amount > GetPlayerMoney(playerid)) SendClientMessage(playerid, COLOR_RED, "ERROR: Insufficient Funds");
	else
	{
		GivePlayerMoney(giveplayerid, amount);
		GivePlayerMoney(playerid, 0 - amount);
		new string[128];
		format(string, sizeof(string), "%s has sent you $%d", ReturnPlayerName(playerid),amount);
		SendClientMessage(giveplayerid, COLOR_YELLOW, string);
        format(string, sizeof(string),"$%d sent to %s", amount,ReturnPlayerName(giveplayerid));
		SendClientMessage(playerid, COLOR_YELLOW, string);
	}
	return 1;
}
Thanks
Reply


Messages In This Thread
givecash command not working - by _Vortex - 08.07.2010, 00:19
Re: givecash command not working - by KJ1 - 08.07.2010, 01:04
Re: givecash command not working - by PotH3Ad - 08.07.2010, 01:17
Re: givecash command not working - by [L3th4l] - 08.07.2010, 01:23
Re: givecash command not working - by selten98 - 08.07.2010, 08:14
Re: givecash command not working - by GaGlets(R) - 08.07.2010, 13:19

Forum Jump:


Users browsing this thread: 1 Guest(s)