Undefined symbol
#1

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

Any help please?

EDIT: Sorry double post
Reply
#3

new carid;
Reply
#4

Tried that to many errors
Reply
#5

(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");
            }
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)