SA-MP Forums Archive
Undefined X - 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 X (/showthread.php?tid=325348)



Undefined X - PjFord - 12.03.2012

Hello, i was scripting some simple commands and i got an error i hadn't gotten before and i can't seem to see what's wrong. the error is this
Код:
C:\Users\Brenda\Desktop\tmp_fm_TcR.pwn(45) : error 017: undefined symbol "X"
C:\Users\Brenda\Desktop\tmp_fm_TcR.pwn(49) : error 017: undefined symbol "X"
C:\Users\Brenda\Desktop\tmp_fm_TcR.pwn(60) : error 017: undefined symbol "X"
C:\Users\Brenda\Desktop\tmp_fm_TcR.pwn(64) : error 017: undefined symbol "X"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
The script is this
pawn Код:
CMD:s(playerid,params[])
{
        if(sscanf(params,"s[128",message)) return SCM(playerid,grey,"USAGE: /s [text]");
        GetPlayerName(playerid,Nam,sizeof(Nam));
        GetPlayerPos(playerid,X,Y,Z);
        format(str,sizeof(str),"%s Shouts: %s",Nam, message);
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                if(IsPlayerInRangeOfPoint(i,20, X,Y,Z))
                {
                    SCM(i,red,str);
                }
        }
        return 1;
}
CMD:w(playerid,params[])
{
        if(sscanf(params,"s[128",message)) return SCM(playerid,grey,"USAGE: /w [text]");
        GetPlayerName(playerid,Nam,sizeof(Nam));
        GetPlayerPos(playerid,X,Y,Z);
        format(str,sizeof(str),"%s Whispers: %s",Nam, message);
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                if(IsPlayerInRangeOfPoint(i, 5.0, X,Y,Z))
                {
                    SCM(i,0xFF925EFF,str);
                }
        }
        return 1;
}
Help would be much appreciated


Re: Undefined X - [ABK]Antonio - 12.03.2012

s[128] <-- your missing the ]


You need to define them

new Float:X, Float:Y, Float:Z;


Re: Undefined X - PjFord - 12.03.2012

Oh! thanks bro i really appreciate it