Integrer error
#2

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;
}
or this Pattern

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;
}
The problem isn't the integer, the problem is how you assign the variable & not updating the money bar
Reply


Messages In This Thread
Integrer error - by feartonyb - 27.11.2013, 21:09
Re: Integrer error - by Patrick - 27.11.2013, 21:12
Re: Integrer error - by Loot - 27.11.2013, 22:27
Re: Integrer error - by feartonyb - 27.11.2013, 22:46
Re: Integrer error - by Loot - 27.11.2013, 23:08
Re: Integrer error - by feartonyb - 28.11.2013, 14:50
Re: Integrer error - by feartonyb - 28.11.2013, 16:27

Forum Jump:


Users browsing this thread: 1 Guest(s)