Undefined symbol "params"?
#1

pawn Код:
if(sscanf(params, "u", receiver)) return SendClientMessage(playerid, -1, " ");
Well, dat's it o.0... U is user right?.. so it gives me this error..

pawn Код:
C:\Users\Guille\Desktop\Samp scripting\Server23\server12\gamemodes\FS_AdminDS.pwn(43) : error 017: undefined symbol "params"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

PS: Never used sscanf before
Reply
#2

Have you included sscanf, and can I see the command this piece of code is inside of?
Reply
#3

Yea, sscanf is included.. and sure

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == 1)
   {
        if(response)
        {
            if(listitem == 0)
            {
                new receiver;
                if(sscanf(params, "u", receiver)) return SendClientMessage(playerid, -1, " ");
                if(IsPlayerConnected(receiver) && receiver != INVALID_PLAYER_ID)
                {
                    ShowPlayerDialog(playerid, 2 , DIALOG_STYLE_INPUT, "{FF0000}Receiver {FFFFFF}ID.", "{FF0000}Input the player's id you are gonna give score\n {FFFFFF}Tip: Player must be connected.", "Give", "");
                }
                else
                {
                    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "{FF0000}Player {FFFFFF}is not connected!", "The player id you typed seems not to be online\n use admcommands to see the admin command list again!", "Ok", "");
                }
            }
        }
    }
    return 1;
}
PS: Don't judge me so high, i'm noob :P
Reply
#4

Quote:
Originally Posted by Strier
Посмотреть сообщение
Yea, sscanf is included.. and sure

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == 1)
   {
        if(response)
        {
            if(listitem == 0)
            {
                new receiver;
                if(sscanf(params, "u", receiver)) return SendClientMessage(playerid, -1, " ");
                if(IsPlayerConnected(receiver) && receiver != INVALID_PLAYER_ID)
                {
                    ShowPlayerDialog(playerid, 2 , DIALOG_STYLE_INPUT, "{FF0000}Receiver {FFFFFF}ID.", "{FF0000}Input the player's id you are gonna give score\n {FFFFFF}Tip: Player must be connected.", "Give", "");
                }
                else
                {
                    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "{FF0000}Player {FFFFFF}is not connected!", "The player id you typed seems not to be online\n use admcommands to see the admin command list again!", "Ok", "");
                }
            }
        }
    }
    return 1;
}
PS: Don't judge me so high, i'm noob :P
You actually need to use "isnull" in this example. I assume the sscanf part is if they left it blank? Try something like this.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == 1)
   {
        if(response)
        {
            if(listitem == 0)
            {
                new receiver;
                if( isnull( inputtext ) ) return SendClientMessage(playerid, -1, " ");
               
                if(IsPlayerConnected(receiver)) // Didn't need to check if receiver was invalid, since IsPlayerConnected does that for you.
                {
                    ShowPlayerDialog(playerid, 2 , DIALOG_STYLE_INPUT, "{FF0000}Receiver {FFFFFF}ID.", "{FF0000}Input the player's id you are gonna give score\n {FFFFFF}Tip: Player must be connected.", "Give", "");
                }
                else
                {
                    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "{FF0000}Player {FFFFFF}is not connected!", "The player id you typed seems not to be online\n use admcommands to see the admin command list again!", "Ok", "");
                }
            }
        }
    }
    return 1;
}
Reply
#5

Everyday you learn new stuff, thanks +rep
Reply
#6

Quote:
Originally Posted by Strier
Посмотреть сообщение
Everyday you learn new stuff, thanks +rep
Not a problem, if you need help with sscanf, feel free to PM me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)