Undefined symbol, playerid? wtf!
#1

Код:
public cannonshot()
{
      if(IsPlayerInAnyVehicle(playerid))
      SetVehicleVelocity(GetPlayerVehicleID(playerid),-4.5,0,0.0);
}
Look, these are the lines where is the error:


C:\Users\William\Downloads\Ti+Stuntacular\gamemode s\Tropical_Island.pwn(470) : warning 225: unreachable code
C:\Users\William\Downloads\Ti+Stuntacular\gamemode s\Tropical_Island.pwn(89 : error 017: undefined symbol "playerid"
C:\Users\William\Downloads\Ti+Stuntacular\gamemode s\Tropical_Island.pwn(899) : error 017: undefined symbol "playerid"
C:\Users\William\Downloads\Ti+Stuntacular\gamemode s\Tropical_Island.pwn(10787) : warning 203: symbol is never used: "Dominating"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

It means what it says, the variable playerid isn't initialized or defined in that callback...if you want the callback specifically for a playerid, you need to specify it in there. For example:

pawn Код:
public cannonshot(playerid)
{
      if(IsPlayerInAnyVehicle(playerid))
      SetVehicleVelocity(GetPlayerVehicleID(playerid),-4.5,0,0.0);
}
Reply
#3

make the forward like:
pawn Код:
forward cannonshot(playerid);
and public:
pawn Код:
public cannonshot(playerid)
, else you won't be able to use playerid symbol.
Reply
#4

Thanks, men, now I have my little cannon xD
I also used the togglecontrolable function
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)