Command only works for a pickup with the ID 1.
#3

pawn Код:
if(strcmp(cmd, "/setentfee", true) == 0)
{
    new playernamez[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playernamez, sizeof(playernamez));
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
        SendClientMessage(playerid, COLOR_RED, "USAGE: /setentfee <entry fee>");
        return 1;
    }
    new entryfee = strval(tmp);
    if(entryfee < 0 || entryfee > 5000) { return SendClientMessage(playerid, COLOR_RED, "Entry fee cannot be lower than $0 or higher than $5000"); }
    new file[31];
    for(new i; i < sizeof(BusinessData); i++)
    {
        format(file, sizeof(file), "BusinessData/%i.txt", i + 1);
        if(IsPlayerInRangeOfPoint(playerid, 2, x, y, z)) // x y z is already defined.
        {
            if(!strcmp(playernamez, BusinessData[i][BusinessOwner], false))
            {
                BusinessData[i][EntFee] = entryfee;
                dini_IntSet(file, "EntFee", entryfee);
                format(string, sizeof(string), "You've set your entry fee to: $%i", entryfee);
                SendClientMessage(playerid, NEWBIE_COLOR, string);
                break;
            }
        }
    }
}
Reply


Messages In This Thread
Command only works for a pickup with the ID 1. - by Biesmen - 10.12.2010, 20:30
Re: Command only works for a pickup with the ID 1. - by Biesmen - 11.12.2010, 16:50
Re: Command only works for a pickup with the ID 1. - by MadeMan - 11.12.2010, 16:59

Forum Jump:


Users browsing this thread: 1 Guest(s)