Posts: 308
Threads: 23
Joined: Jun 2012
^^^^^ He Fixed It Now For The Whole Command
PHP код:
CMD:givemoney(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 4)
{
new string[128], giveplayerid, money;
if(sscanf(params, "ud", giveplayerid, money)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givemoney [player] [money]");
if(IsPlayerConnected(giveplayerid))
{
GivePlayerCash(giveplayerid, money);
format(string, sizeof(string), "You have given %s $%d !",GetPlayerNameEx(giveplayerid),money);
SendClientMessageEx(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "%s has given %s $%d (/givemoney)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid),money);
Log("logs/stats.log", string);
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
}
return 1;
}
d means doubles like 2.5 9.3 ...
i means integer numbers from infinite negative to infinity positive.
However yes mostly they are the same but i preffer i for this specific operation.
EDIT: and i don't think you can set player's money to a negative amount using d