OnPlayerUpdate causing errors...
#1

I am using OnPlayerUpdate in a script of mine, basically, every time i insert this "OnPlayerUpdate" function into my script, it stops all players from syncing, and whenever i go near a player they appear to be stood still, or stood on top of their vehicle (if they are in one).

Here is the OnPlayerUpdate section:

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerTeam(playerid) == 1)
    {
        if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)) == 0)
        {
            if(gMissionInt[playerid] == 1)
            {
                GameTextForPlayer(playerid, "Reattach your trailer!", 1500, 4);
            }
            return 1;
        }
    }
   
    if(IsPlayerInAnyVehicle(playerid) == 0)
    {
        if(gMissionInt[playerid] == 1)
        {
            GameTextForPlayer(playerid, "Get back in you're vehicle!", 1500, 4);
        }
    }

    //STOP  =  Broken Down :)
    if(IsPlayerInAnyVehicle(playerid) == 1)
    {
        new Float:VehicleHealth;
        GetVehicleHealth(GetPlayerVehicleID(playerid), VehicleHealth);
        if(VehicleHealth < 250)
        {
            GameTextForPlayer(playerid, "You have broken down, ~n~~r~call /assistance", 1001, 5);
            SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 0.0);
        }
    }
    return 0;
}
This error only happens when OnPlayerUpdate is called. If i remove the above code from my script, everything works perfectly again.

What is wrong?
Thanks
Ash
Reply


Messages In This Thread
OnPlayerUpdate causing errors... - by Ash. - 12.08.2010, 19:26
Re: OnPlayerUpdate causing errors... - by Johnny_Xayc - 12.08.2010, 19:28
Re: OnPlayerUpdate causing errors... - by JaTochNietDan - 12.08.2010, 19:29
Re: OnPlayerUpdate causing errors... - by pmk1 - 12.08.2010, 19:29
Re: OnPlayerUpdate causing errors... - by Ash. - 12.08.2010, 19:52

Forum Jump:


Users browsing this thread: 1 Guest(s)