12.08.2010, 19:26
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:
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
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;
}
What is wrong?
Thanks
Ash