27.11.2013, 21:12
pawn Код:
CMD:givemoney(playerid, params[])
{
new id, ammountcash, givemstring[128];
if(sscanf(params, "ui", id, ammountcash))
return SendClientMessage(playerid, -1, "Use: /pay [Player] [Ammount]");
GivePlayerMoney(playerid, ammountcash);
//PlayerInfo[playerid][Money] += ammountcash; - This won't work because there's no stock that updates the Money.
format(givemstring, sizeof(givemstring), "You gave him $%d", ammountcash);
SendClientMessage(playerid, -1, givemstring);
return 1;
}
pawn Код:
CMD:givemoney(playerid, params[])
{
new id, ammountcash, givemstring[128];
if(sscanf(params, "ui", id, ammountcash))
return SendClientMessage(playerid, -1, "Use: /pay [Player] [Ammount]");
GiveLegitMoney(playerid, ammountcash);
format(givemstring, sizeof(givemstring), "You gave him $%d", ammountcash);
SendClientMessage(playerid, -1, givemstring);
return true;
}
stock GiveLegitMoney(playerid, ammount)
{
GivePlayerMoney(playerid, ammount);
PlayerInfo[playerid][Money] += ammount;
return true;
}