SSCANF -_-
#1

pawn Код:
CMD:faction(playerid, params[])
{
    if(playerVariables[playerid][pStatus] == 1)
    {
        new
            action[32],
            string[256],
            id,
            pin;
        if(sscanf(params, "s[32]", action)) {
            SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/faction [action]");
            SendClientMessage(playerid, COLOR_GREY, "ACTIONS: login");
        }
        if(strcmp(action, "login", true) == 0)
        {
            if(sscanf(params, "dd", id,pin)) {
                return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/faction login [id group] [pin]");
            }
If i write /faction, it shows me:
Код:
SYNTAX: /faction [action]
ACTIONS: login
SYNTAX: /faction login [id group] [pin]
If i write /faction login 1 434 it doesn't show me nothing.

The problem is here:

pawn Код:
if(sscanf(params, "dd", id,pin)) {
                return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/faction login [id group] [pin]");
            }
I tried a lot of ways..
Reply
#2

Try to debug!

After line if(sscanf(params, "dd", id,pin)) add

SendClientMessage(playerid, -1, "TEST");

If it will work, then there's no problem, you didnt added anything after sscanf check.
Reply
#3

I know that.. I put SendClientMessage(playerid,COLOR_GREY,"1."); before that, and text 2 after. And just 1. showed me..
Reply
#4

Resolved..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)