04.02.2011, 20:02
Hey i just noticed that i can steal money from others with this code
But how can i prevent that?
Greets Thimo
Код:
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; }
Greets Thimo