Whats wrong with this script?
#1

Alright well I made a command that changes the business name, but when I type the command it shows the syntax, and if I type it correctly, it says Invalid business id (When it is the correct ID)
pawn Код:
command(setbusinessname, playerid, params[])
{
    new Name[255], id, string[128];
    if(sscanf(params, "z", id, Name)) {
        if(Player[playerid][AdminLevel] >= 4) {
            SendClientMessage(playerid, WHITE, "/setbusinessname [businessid] [Name]");
        }
    }
    else {
        if(Player[playerid][AdminLevel] >= 4) {
            format(string, sizeof(string), "Businesses/Business_%d.ini", id);

            if(!fexist(string)) {
                SendClientMessage(playerid, WHITE, "Invalid business ID!");
                return 1;
            }
            else {
                Businesses[id][bName] = Name;
                SaveBusiness(id);
                format(string, sizeof(string), "You have set the business name to %d.", Name);
                SendClientMessage(playerid, WHITE, string);
            }
        }
    }
    return 1;
}
Using vortex script if anyone can figure it out
Reply


Messages In This Thread
Whats wrong with this script? - by patfay - 10.06.2011, 16:51
Re: Whats wrong with this script? - by Calgon - 10.06.2011, 17:09
Re: Whats wrong with this script? - by patfay - 10.06.2011, 17:24

Forum Jump:


Users browsing this thread: 1 Guest(s)