/removemoney
#1

Hello, i have script a /givemoney Command and all works, but how can i make a /removemoney Command, to remove from a Player any Money?

Here the /givemoney Cmd:

Код:
COMMAND:givemoney(playerid, params[])
{
    new targetid, amount;
    if(PlayerAdmin[playerid] < 4) return SendClientMessage(playerid,COLOR_RED,"You cannot use this Command!");
    if(sscanf(params, "ud", targetid, amount)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /givemoney <Part of Name/ ID> <Money>");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Player is not connected");
    GivePlayerMoneyEx(targetid, amount);
    return 1;
}
Reply
#2

https://sampwiki.blast.hk/wiki/ResetPlayerMoney
Reply
#3

Just change from GivePlayerMoneyEx(targetid, amount); to ResetPlayerMoney(targetid);
Reply
#4

Код:
COMMAND:removemoney(playerid, params[])
{
    new targetid, amount;
    if(PlayerAdmin[playerid] < 4) return SendClientMessage(playerid,COLOR_RED,"You cannot use this Command!");
    if(sscanf(params, "ud", targetid, amount)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /removemoney <Part of Name/ ID> <Money>");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Player is not connected");
    GivePlayerMoneyEx(targetid, -amount);
    return 1;
}
Reply
#5

Works, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)