22.05.2017, 07:19
Errors are fixed, but the textdraw is not showing..
Under public OnPlayerConnect(playerid)
Under public OnPlayerStateChange(playerid, newstate, oldstate)
Код:
new PlayerText:vSpeedBox[MAX_PLAYERS]
Код:
vSpeedBox[playerid] = CreatePlayerTextDraw(playerid,540.666259, 418.637756, "0"); PlayerTextDrawLetterSize(playerid, vSpeedBox[playerid], 0.000000, -3.155556); PlayerTextDrawTextSize(playerid, vSpeedBox[playerid], 649.999572, 0.000000); PlayerTextDrawAlignment(playerid, vSpeedBox[playerid], 1); PlayerTextDrawColor(playerid, vSpeedBox[playerid], 0); PlayerTextDrawUseBox(playerid, vSpeedBox[playerid], true); PlayerTextDrawBoxColor(playerid, vSpeedBox[playerid], 102); PlayerTextDrawSetShadow(playerid, vSpeedBox[playerid], 0); PlayerTextDrawSetOutline(playerid, vSpeedBox[playerid], 0); PlayerTextDrawFont(playerid, vSpeedBox[playerid], 2);
Код:
if(newstate == PLAYER_STATE_DRIVER) { new str [ 30 ]; vID = GetPlayerVehicleID(playerid); vv = GetVehicleModel(vID); LinkVehicleToInterior(vID, GetPlayerInterior(playerid)); format(str, sizeof(str), "%s", vehName[vv - 400]); PlayerTextDrawSetString(playerid, vTD[playerid], str); PlayerTextDrawShow(playerid, vTD[playerid]); SetTimerEx("hidevTD", 3200, false, "i", playerid); // Hide Box if(Speedo[playerid] == 1) { SetTimerEx("speedinfotd",1000,1,"d",playerid); PlayerTextDrawShow(playerid, vSpeed[playerid]); PlayerTextDrawShow(playerid, vSpeedBox[playerid]); } }
Код:
forward speedinfotd(playerid); public speedinfotd(playerid) { new String [ 30 ]; new Float:X; new Float:Y; new Float:Z; GetVehicleVelocity(GetPlayerVehicleID(playerid),X,Y,Z); format(String,150,"~W~~Y~%d",floatround(floatsqroot(X * X + Y * Y + Z * Z) * 200.0000)); PlayerTextDrawSetString(playerid, vSpeedBox[playerid], String); return 1; }