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
#2

You haven't made that command, you've destroyed perfectly functioning code.

Change:
pawn Код:
if(sscanf(params, "z", id, Name)) {
to:

pawn Код:
if(sscanf(params, "ds", id, Name)) {
Reply
#3

Well I didnt make it 100 percently, I took two commands and combined them together
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)