09.01.2015, 17:37
Quote:
Maybe you're being set to another virtual world?
Or maybe you're returning 0 in your OnPlayerUpdate callback at some point, that might cause this. I'm not sure though. |
Код:
public OnPlayerUpdate(playerid) { SpeedoUpdate(playerid); static s_iVehicle; if(g_fSpeedCap[playerid] != 0.0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { s_iVehicle = GetPlayerVehicleID(playerid); if (s_iVehicle) { static Float:s_fX, Float:s_fY, Float:s_fZ, Float:s_fVX, Float:s_fVY, Float:s_fVZ; GetVehiclePos(s_iVehicle, s_fX, s_fY, s_fZ); GetVehicleVelocity(s_iVehicle, s_fVX, s_fVY, s_fVZ); if(!IsPlayerInRangeOfPoint(playerid, g_fSpeedCap[playerid] + 0.05, s_fX + s_fVX, s_fY + s_fVY, s_fZ + s_fVZ)) { static Float:s_fLength; s_fLength = floatsqroot((s_fVX * s_fVX) + (s_fVY * s_fVY) + (s_fVZ * s_fVZ)); s_fVX = (s_fVX / s_fLength) * g_fSpeedCap[playerid]; s_fVY = (s_fVY / s_fLength) * g_fSpeedCap[playerid]; s_fVZ = (s_fVZ / s_fLength) * g_fSpeedCap[playerid]; if(s_iVehicle) { SetVehicleVelocity(s_iVehicle, s_fVX, s_fVY, s_fVZ); } else { SetPlayerVelocity(playerid, s_fVX, s_fVY, s_fVZ); } } } } return 1; } stock SpeedoUpdate(playerid) { new vehicleid = GetPlayerVehicleID(playerid), msg[40], Float:vHP,; if(vehicleid == 0) return 1; format(msg, 40, "~w~Bukle: ~g~~h~%.1f%~w~%%", vHP); PlayerTextDrawSetString(playerid, SpidometroPlayerTD[playerid][5], msg); }