%S mONEY
#1

Hello, I would like to make a script /take ID mONEY so i just need to know how to set the %s of the money.

+REP!
Reply
#2

pawn Код:
YCMD:take(playerid, params[], help)
{
    #pragma unused help
    new pID, pAmmount, str[70];

    if(sscanf(params, "ui", pID, pAmmount))
        return SendClientMessage(playerid, -1, "Usage: /take [PlayerID / Name] [Amount]");

    if(pAmmount < 0)
        return SendClientMessage(playerid, -1, "Error: Invalid amount. Use positive values only..");
           
    format(str, sizeof str, "You took %i$ from %s.", pAmount, pName(pID));
    SendClientMessage(playerid, -1, str);
    format(str, sizeof str, "%s took %i from you.", pName(playerid), pAmount);
    SendClientMessage(pID, -1, str);
    GivePlayerMoney(pID, -pAmount);
    GivePlayerMoney(playerid, pAmount);
    return 1;
}
stock pName(playerid)
{
        new Name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name, sizeof Name);
        return Name;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)