SA-MP Forums Archive
command problem - 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: command problem (/showthread.php?tid=602836)



command problem - Shaheen - 14.03.2016

i am looking to make a /loc system
when a player types /loc [id] it shows the player loc and car but it shows me some errors while doing with ssanf

here is the code
Код:
CMD:loc(playerid, params[])
{
    new id;
    new target, current_zone;
    current_zone = player_zone[target];
    if(sscanf(params, "u", id))
    {
        SendClientMessage(playerid, 0xFF0000FF, "Usage: /loc [playerid]");
    }
    else
    {
        if(current_zone != -1 && IsPlayerConnected(target))
        {
            new playername[MAX_PLAYER_NAME],message2[170];
            GetPlayerName(id,playername,MAX_PLAYER_NAME);
            format(message2,sizeof(message2),"%s(%d)'s current location: %s",playername,target,zones[current_zone][zone_name]);
            SendClientMessage(playerid,0x00C7FFAA,message2);
        }
        else
        {
            SendClientMessage(playerid,red,"Invalid Player ID");
        }
    }
}



Re: command problem - XtremeRz - 14.03.2016

First of all, where did you define player_zone[target].

And show me the errors.


Re: command problem - Shaheen - 15.03.2016

Quote:
Originally Posted by XtremeRz
Посмотреть сообщение
First of all, where did you define player_zone[target].

And show me the errors.
Код:
C:\Users\Farha\Desktop\New folder\filterscripts\Untitled.pwn(984) : error 017: undefined symbol "player_zone"
C:\Users\Farha\Desktop\New folder\filterscripts\Untitled.pwn(984) : warning 215: expression has no effect
C:\Users\Farha\Desktop\New folder\filterscripts\Untitled.pwn(984) : error 001: expected token: ";", but found "]"
C:\Users\Farha\Desktop\New folder\filterscripts\Untitled.pwn(984) : error 029: invalid expression, assumed zero
C:\Users\Farha\Desktop\New folder\filterscripts\Untitled.pwn(984) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.