Givecash
#1

Hey i just noticed that i can steal money from others with this code
Код:
CMD:givecash(playerid, params[])
{
	new
		giveplayerid,
		amount;
	if (sscanf(params, "dd", giveplayerid, amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /givecash [playerid] [amount]");
	else if (!IsPlayerConnected(giveplayerid)) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
	else if (amount > GetPlayerMoney(playerid)) SendClientMessage(playerid, 0xFF0000AA, "Insufficient Funds");
	else
	{
		RewardPlayer(giveplayerid, amount,0);
		RewardPlayer(playerid, 0 - amount, 0);
		SendClientMessage(playerid, 0x00FF00AA, "Money sent");
		SendClientMessage(giveplayerid, 0x00FF00AA, "Money recieved");
	}
	return 1;
}
But how can i prevent that?

Greets Thimo
Reply


Messages In This Thread
Givecash - by thimo - 04.02.2011, 20:02
Re: Givecash - by bartje01 - 04.02.2011, 20:06
Re: Givecash - by Fj0rtizFredde - 04.02.2011, 20:07
Re: Givecash - by admantis - 04.02.2011, 20:07
Respuesta: Givecash - by OPremium - 04.02.2011, 20:16
Re: Respuesta: Givecash - by bartje01 - 04.02.2011, 20:27
Re: Respuesta: Givecash - by admantis - 04.02.2011, 20:30

Forum Jump:


Users browsing this thread: 1 Guest(s)