24.11.2017, 11:09
The speedometer I'm using works perfectly fine. One issue if a second player enters a vehicle the other players speedometer shows as well.
Thanks in Advance.
(Under OnPlayerConnect)
(Under OnPlayerDisconnect)
Thanks in Advance.
PHP код:
new Text:SpeedoText[MAX_PLAYERS];
PHP код:
SpeedoText[playerid] = TextDrawCreate(540.000000, 400.000000, " ");
TextDrawAlignment(SpeedoText[playerid], 1);
TextDrawFont(SpeedoText[playerid],2);
TextDrawLetterSize(SpeedoText[playerid], 0.310, 1.400);
TextDrawSetShadow(SpeedoText[playerid],0);
TextDrawUseBox(SpeedoText[playerid], 0);
TextDrawBoxColor(SpeedoText[playerid], 0x00);
PHP код:
TextDrawDestroy(SpeedoText[playerid]);
PHP код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(IsPlayerInAnyVehicle(playerid) && !IsBicycle(GetPlayerVehicleID(playerid)))
{
TextDrawShowForPlayer(playerid, SpeedoText[playerid]);
}
else
{
TextDrawHideForPlayer(playerid, SpeedoText[playerid]);
}