SA-MP Forums Archive
[Help] Sccanf not working - 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: [Help] Sccanf not working (/showthread.php?tid=551988)



[Help] Sccanf not working - Arxalan - 22.12.2014

Hello , i added sscanf.dll and sscanf.so file in my plugins folder and also sscanf.inc and sscanf2.inc in /pawno/ include folder but when i use this command
PHP код:
new str[128], str2[128] , NAME1[MAX_PLAYER_NAME], NAME2[MAX_PLAYER_NAME];
CMD:pm(playereid params[])
{
if(
sscanf(params"us"idstr2))
{
    
SendClientMessage(playerid0xFF0000FF"Usage: /pm <id/name> <message>");
    return 
1;
}
return 
1;

It says Undefined symbol "sscanf" and Undefined symbol "playerid" . if i remove this command
PHP код:
if(sscanf(params"us"idstr2))
{
    
SendClientMessage(playerid0xFF0000FF"Usage: /pm <id/name> <message>");
    return 
1;

then i got no errors . i also tried to paste that command after the closing braces of CMD : pm ( i used here spaces because if i dont use the emo appears) (as i am n00b so i try all the ways) but not working .
Please help me


Re: [Help] Sccanf not working - MD5 - 22.12.2014

Did you include it?

Код:
#include <sscanf2>



Re: [Help] Sccanf not working - Arxalan - 22.12.2014

Thanks now it is working now but i got new error again
Undefined Symbol "id" and Undefined symbol "playerid"


Re: [Help] Sccanf not working - JaKe Elite - 22.12.2014

Create a variable name "id" (new id;)

and include the #include <zcmd> below #include <sscanf2>


Respuesta: [Help] Sccanf not working - JuanStone - 22.12.2014

They are not necessary variables to use sscanf, you could use the slots to sscanf, define their includes and try it out with this.

pawn Код:
CMD:pm(playereid , params[])
{
    new string_message[128];
    if(sscanf(params, "us[128]", params[0], string_message)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id/name> <message>");
    if(strlen(string_message) > 1 && strlen(string_message) < 127)
    {
        new pm_string[144], Name[24];
        GetPlayerName(playerid, Name, 24);
        format(pm_string, sizeof(pm_string), "new pm %s(%d): %s", Name, playerid, pm_string);
        SendClientMessage(paramas[0], -1, pm_string);
       
        SendClientMessage(playerid, -1, "Message ensend.");
    }
    else
    {
        SendClientMessage(playerid, -1, "Incorrect minim 2 caracters, mбx 127+carachter null.");
    }
    return 1;
}