Errors
#1

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);
Reply
#2

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?
Reply
#3

Yes i think it is
Reply
#4

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

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
Reply
#6

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

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?
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)