sscanf problem
#1

SLOVED:

Converted all commands into dialogs! lel.
Reply
#2

Quote:
Originally Posted by kepa333
Посмотреть сообщение
pawn Код:
if(!sscanf(params, "s[128]", params))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit [option] [gateid]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: object | close | open | speed | password");
        return 1;
    }
Change:
pawn Код:
if(!sscanf(params, "s[128]", params))
To this:
pawn Код:
if(sscanf(params, "s[128]", params))
Reply
#3

Quote:
Originally Posted by Ciarannn
Посмотреть сообщение
Change:
pawn Код:
if(!sscanf(params, "s[128]", params))
To this:
pawn Код:
if(sscanf(params, "s[128]", params))
I'been playing with this code for 2 hours,

pawn Код:
if(sscanf(params, "s[128]", params))
this was made in original code and it dosen't work :S
Reply
#4

Quote:
Originally Posted by kepa333
Посмотреть сообщение
I'been playing with this code for 2 hours,

pawn Код:
if(sscanf(params, "s[128]", params))
this was made in original code and it dosen't work :S

Try this:

pawn Код:
if(sscanf(params, "s[128]i", params, idx))
Sorry about the last reply, I didn't realize that there where two problems with the code.
Reply
#5

It's still same... cant pass first msg.
Reply
#6

Here's an example:
pawn Код:
CMD:gedit(playerid, params[])
{
    new option[128], gateid;
    if(sscanf(params, "s[128]i", option, gateid))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit [option] [gateid]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: object | close | open | speed | password");
        return 1;
    }

    if(strcmp(option, "object", true) == 0)
    {
        // Code...
    }
    else if(strcmp(option, "close", true) == 0)
    {
        // Code...
    }
    else if(strcmp(option, "open", true) == 0)
    {
        // Code...
    }
    else if(strcmp(option, "speed", true) == 0)
    {
        // Code...
    }
    else if(strcmp(option, "password", true) == 0)
    {
        // Code...
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit [option] [gateid]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: object | close | open | speed | password");
    }
    return 1;
}
And I suggest that you leave the issue on the main post for future issues which are similar to yours.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)