SA-MP Forums Archive
Undefined symbol "params"? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Undefined symbol "params"? (/showthread.php?tid=419210)



Undefined symbol "params"? - Strier - 27.02.2013

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


Re: Undefined symbol "params"? - 2KY - 27.02.2013

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


Respuesta: Undefined symbol "params"? - Strier - 27.02.2013

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


Re: Respuesta: Undefined symbol "params"? - 2KY - 27.02.2013

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;
}



Respuesta: Undefined symbol "params"? - Strier - 27.02.2013

Everyday you learn new stuff, thanks +rep


Re: Respuesta: Undefined symbol "params"? - 2KY - 27.02.2013

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.