Public function lacks forward declaration
#1

This is my second attempt. I'm using Fallouts, "Player Damage on Car Damage Code" which I found using the, "SEARCH" button. But, it was in a help topic and the topic was old so I decided not to post anything there and post here instead. This is the error I get.

Код:
C:\Users\User\Desktop\SAMP Script #2\pawno\seatbelt.pwn(162) : warning 235: public function lacks forward declaration (symbol "OnPlayerUpdate")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
But, I have no idea... Yeah, I know... And here's the code.

pawn Код:
public OnPlayerUpdate(playerid) // LINE 162
{
    if(IsPlayerInAnyVehicle(playerid) == 1 && Seatbelt[playerid] == 0)
    {
        new Float:TempCarHealth;
        GetVehicleHealth(GetPlayerVehicleID(playerid), TempCarHealth);
        new Float:Difference = floatsub(CarHealth[playerid], TempCarHealth);
        if((floatcmp(CarHealth[playerid], TempCarHealth) == 1) && (floatcmp(Difference,100.0) == 1))
        {
          Difference = floatdiv(Difference, 10.0);
          new Float:OldHealth;
          GetPlayerHealth(playerid, OldHealth);
          SetPlayerHealth(playerid, floatsub(OldHealth, Difference));
        }
        CarHealth[playerid] = TempCarHealth;
    }
    else
    {
        CarHealth[playerid] = 0.0;
    }
  return 1;
}
Reply
#2

Just add
pawn Код:
forward OnPlayerUpdate(playerid);
Maybe you are using old a_samp.inc where OnPlayerUpdate isn't forwarded by default (since it hadn't existed yet).
Reply
#3

update you samp server package
Reply
#4

Quote:
Originally Posted by Sergiy
Just add
pawn Код:
forward OnPlayerUpdate(playerid);
Maybe you are using old a_samp.inc where OnPlayerUpdate isn't forwarded by default (since it hadn't existed yet).
Nah, I have the new a_samp.. I just forgot to put
Код:
forward OnPlayerUpdate(playerid);
, hehe... I'm kinda' dumb but thanks for the help both of you though. Thanks alot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)