19.06.2018, 19:47
Quote:
it should be
PHP код:
|
"dist" variable should be a float as GetPlayerDistanceFromPoint returns a float value. PlayertextDrawSetString, third argument is supposed to be "string" (and not an integer as in your case or float as in mine). In this case, you either do what Lokii did, or you keep "dist" value and assign it to a temporary string you will use for the textdraw.
I would use the second option since you might need to use this "float" value later on (comparison or anything similar).
PHP код:
new Float:fDist, tmpStr[10];
fDist = GetPlayerDistanceFromPoint(playerid, Safe[sid][safe_Pos][0], Safe[sid][safe_Pos][1], Safe[sid][safe_Pos][2]);
format(tmpStr, sizeof(tmpStr), "%0.2f", fDist);
PlayerTextDrawSetString(playerid, editthis[playerid], tmpStr);