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



Errors - friezakinght - 28.06.2014

I get these errors:
Код:
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(1649) : error 017: undefined symbol "Player"
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(17950) : error 017: undefined symbol "PRESSED"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Please help, these are the lines:

1649:
pawn Код:
if(Player == id) continue;
Full code for line 1649:
pawn Код:
stock Arrest(playerid, i = -1)
{
    new Float:x, Float:y, Float:z, Float:hp;
    if(i != -1)
    {
        GetPlayerPos(i, x, y, z);
        GetPlayerHealth(i, hp);
        if(hp < 0.0 || !IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z) || GetPlayerInterior(playerid) != GetPlayerInterior(i) || GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(i) || GetPlayerWantedLevel(i) < 4 || IsPlayerInAnyVehicle(i) != 0 || IsOnduty{i} != 0 || IsAtEvent{i} != 0 || HasBeenArrested{i} == true) return SendClientMessage(playerid, RED, "Player cannot be arrested");
    }
    else if(i == -1)
    {
        foreach(Player, id)
        {
            if(Player == id) continue;
            GetPlayerPos(id, x, y, z);
            GetPlayerHealth(id, hp);
            if(hp == 0.0 || !IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z) || GetPlayerInterior(playerid) != GetPlayerInterior(id) || GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(id) || GetPlayerWantedLevel(id) < 4 || IsPlayerInAnyVehicle(id) != 0 || IsOnduty{id} != 0 || IsAtEvent{id} != 0 || HasBeenArrested{id} == true) continue;
            i = id;
            break;
        }
        if(i == -1) return SendClientMessage(playerid, RED, "No wanted players in range.");
    }
Line 17950:

pawn Код:
if(GetTeam{playerid} != CLASS_CIV && GetTeam{playerid} != CLASS_MEDIC && PRESSED(KEY_SUBMISSION)) Arrest(playerid);



Re: Errors - Konstantinos - 28.06.2014

Get the macro of PRESSED here: https://sampwiki.blast.hk/wiki/OnPlayerK...pressing_a_key

About the "Player", that's the iterator of foreach, the variable that stores the players' ID is "id" so you probably want to check if "id" is equal with "i" which is not -1 and it's an ID of a player?


Re: Errors - friezakinght - 28.06.2014

Yes i think it is


Re: Errors - friezakinght - 28.06.2014

Someone? I still got to fix the error with player..


Re: Errors - BroZeus - 28.06.2014

if(Player == id) continue;
change this to this
if(playerid == id) continue;

EDIT: and with this also do the thing in the post below this


Respuesta: Errors - SickAttack - 28.06.2014

You aren't using foreach correctly:
pawn Код:
foreach(new id: Player)



Re: Errors - friezakinght - 28.06.2014

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
if(Player == id) continue;
change this to this
if(playerid == id) continue;

EDIT: and with this also do the thing in the post below this
Wouldn't playerid make me arrest myself?


Re: Errors - BroZeus - 28.06.2014

no it would not
you can test it just try it out