SA-MP Forums Archive
Undefined symbol - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Undefined symbol (/showthread.php?tid=81629)



Undefined symbol - JoeDaDude - 12.06.2009

pawn Код:
forward IsACopCar(carid);

---------------------------------------

new index;
new cmd[20];
cmd = strtok(cmdtext, index);
if (strcmp(cmd, "/cuff", true) == 0)
{
new tmp[20];
tmp = strtok(cmdtext, index);
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
if (IsACopCar(carid))
{
SendClientMessage(id, 0xFFFFFFFFF, "You have been cuffed and cannot move");
TogglePlayerControllable(id,0);
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You're not in a registered cop car");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player is not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "[Usage]: /cuff [playerid/name]");
}
return 1;
}
if (strcmp(cmd, "/uncuff", true) == 0)
{
new tmp[20];
tmp = strtok(cmdtext, index);
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
SendClientMessage(id, 0xFFFFFFFFF, "You have been uncuffed");
TogglePlayerControllable(id,1);
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "[Usage]: /uncuff [playerid/name]");
}
return 1;
}

---------------------------------------

public IsACopCar(carid)
{
    new vehicle = GetVehicleModel(carid);
    if(vehicle == 597)
    {
        return 1;
    }
    return 0;
}
What is wrong?

Код:
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(37) : error 017: undefined symbol "carid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.

Does anyone have a solution


Re: Undefined symbol - JoeDaDude - 12.06.2009

Any help please?

EDIT: Sorry double post


Re: Undefined symbol - Kyle - 12.06.2009

new carid;


Re: Undefined symbol - JoeDaDude - 12.06.2009

Tried that to many errors


Re: Undefined symbol - pen_theGun - 12.06.2009

(IsACopCar(carid)) // 'carid' not defined

IsACopCar( GetPlayerVehicleID( id ) ) // here is no need to define something

pawn Код:
if (IsPlayerConnected(id))
        {
            if (IsACopCar( GetPlayerVehicleID( id ) )) // <=====
            {
                SendClientMessage(id, 0xFFFFFFFFF, "You have been cuffed and cannot move");
                TogglePlayerControllable(id,0);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, 0xFF0000AA, "You're not in a registered cop car");
            }
        }