17.03.2015, 22:33
I get into my car, my speedo does not show up?
Код:
stock ShowSpeedo(playerid) { PlayerTextDrawShow(playerid, SpeedoText0); PlayerTextDrawShow(playerid, SpeedoText1); PlayerTextDrawShow(playerid, SpeedoText2); PlayerTextDrawShow(playerid, SpeedoText3); PlayerTextDrawShow(playerid, SpeedoText4); PlayerTextDrawSetString(playerid,SpeedoText0,"~b~SPEED:~n~~w~0 MPH~n~~g~GAS: ~w~100.00"); PlayerInfo[playerid][pSpeedoOn] =1; } stock HideSpeedo(playerid) { PlayerTextDrawHide(playerid, SpeedoText0); PlayerTextDrawHide(playerid, SpeedoText1); PlayerTextDrawHide(playerid, SpeedoText2); PlayerTextDrawHide(playerid, SpeedoText3); PlayerTextDrawHide(playerid, SpeedoText4); PlayerInfo[playerid][pSpeedoOn] =0; }
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) { ShowSpeedo(playerid); } if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT) { HideSpeedo(playerid); } return 1; }