abuse money
#7

Quote:
Originally Posted by Quickie
Посмотреть сообщение
pawn Код:
CMD:free(playerid, params[])
{
    new id, amount, szDialogString[250];
    if(sscanf(params, "ui", id, amount)) return SCM(playerid, -1, "Syntax: /free [playerid] [price]");
add this after ^^^^ or just uncomment it

pawn Код:
if(price>4500)return SCM(playerid,-1,"Error: Price cant be above 4500");
if(GetPlayerMoney(id)<price)return SCM(playerid,-1,"Error: player doesnt have enough cash");
it checks if the target player doesnt have enough and if so give an error message in this case if player have less than the amount requested by the cop
ang the request amount of the cop limited to 4500..
no understand , u mean ?
me i did it :
pawn Код:
CMD:free(playerid, params[])
{
    new id, amount, price, szDialogString[250];
    if(sscanf(params, "ui", id, amount)) return SCM(playerid, -1, "Syntax: /free [playerid] [price]");
        if(price>4500)return SCM(playerid,-1,"Error: Price cant be above 4500");
        if(GetPlayerMoney(id)<price)return SCM(playerid,-1,"Error: player doesnt have enough cash");
    if(IsPlayerInRangeOfPlayer(playerid, id, 10.0))
    {
        if(playerVariables[playerid][pGroup] == 1 || playerVariables[playerid][pGroup] == 2 || playerVariables[playerid][pGroup] == 3 ||  playerVariables[playerid][pGroup] == 5)
        {
            if(playerVariables[playerid][pRobPoints] >= 3)
            {
                GetPlayerName(id, szPlayerName, MAX_PLAYER_NAME);
                format(szMessage, sizeof(szMessage), "You offered %s a free, with a price of: %d$", szPlayerName, amount);
                SCM(playerid, COLOR_LIGHTGREEN, szMessage);

                GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

                SetPVarInt(id, "fID", playerid);
                SetPVarInt(id, "fPrice", amount);

                format(szDialogString, 250, "%s is offering you a free at a price of $%d. Do you wish to accept?", szPlayerName, amount);
                ShowPlayerDialog(id, DIALOG_FREE, DIALOG_STYLE_MSGBOX, "Server: Free", szDialogString, "Accept", "Decline");
            }
            else return SCM(playerid, -1,"Nu ai destule lawer points");
        }
        else
        {
            SCM(playerid, -1, "You are not a cop!");
        }
    }
    else
    {
        SCM(playerid, -1, "You need to be near the player you wish to free!");
    }
    return 1;
}
wrong?
Reply


Messages In This Thread
abuse money - by KingPersona - 03.10.2014, 22:00
Re: abuse money - by AndySedeyn - 03.10.2014, 22:02
Re: abuse money - by KingPersona - 03.10.2014, 22:34
Re: abuse money - by Quickie - 04.10.2014, 05:40
Re: abuse money - by KingPersona - 04.10.2014, 11:12
Re: abuse money - by Quickie - 04.10.2014, 12:01
Re: abuse money - by KingPersona - 04.10.2014, 13:17

Forum Jump:


Users browsing this thread: 2 Guest(s)