TextDraw Problem ! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: TextDraw Problem ! (
/showthread.php?tid=217838)
TextDraw Problem ! UNSOLVED -
Yaszine - 28.01.2011
Hello everyone
So, I have UpdateSpeedo(); OnPlayerConnect
This is it:
pawn Код:
UpdateSpeed()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
new Float:Sp_x, Float:Sp_y, Float:Sp_z, Float:f_speed, f_speed_int;
new S_string[256];
new Float:vh;
new vehicleid;
vehicleid = GetPlayerVehicleID(i);
GetVehicleHealth(vehicleid, vh);
GetVehicleVelocity(vehicleid,Sp_x,Sp_y,Sp_z);
f_speed = floatsqroot(((Sp_x*Sp_x)+(Sp_y*Sp_y))+(Sp_z*Sp_z))*136.666667; /*MPH = 85.4166672*/
f_speed_int = floatround(f_speed,floatround_round);
format(S_string,256,"~g~Vehicule : ~w~%s ~n~~g~~h~~h~Ping : ~w~%d / ~b~KM/H : ~w~%d ~n~~r~Vehicle Health:~w~ %.2f",Vehiclex[GetVehicleModel(vehicleid)-400],GetPlayerPing(i),f_speed_int,vh);
Speedox[i] = TextDrawCreate(320.00, 380.00, S_string);
TextDrawSetOutline(Speedox[i], 1);
TextDrawFont(Speedox[i], 3);
TextDrawSetProportional(Speedox[i], 2);
TextDrawAlignment(Speedox[i], 2);
//TextDrawLetterSize(Speedox[i],0.29,0.83);
TextDrawSetShadow(Speedox[i],0);
}
}
If player connect to server, the text draw not works (SpeedoMeter if he take a car should show but .. ?!)
How can I place it under OnGameModeInit ?!
Because there is "playerid" and many other functions that OnGameModeInit not support
PS: And how can the TextDraw created change if KM/h ~ Ping .. changed ?
Thanks very much
Re : TextDraw Problem ! -
Yaszine - 29.01.2011
Anyone
Re: TextDraw Problem ! -
armyoftwo - 29.01.2011
You need to use SetTimerEx() under OnPlayerConnect to call the function all the time
Re : TextDraw Problem ! -
Yaszine - 29.01.2011
Yes I'll do, but where can I put the TextDraw creation ?
Re : TextDraw Problem ! -
Yaszine - 29.01.2011
Please
Re: TextDraw Problem ! -
Stigg - 29.01.2011
TextDrawShowForPlayer Perhaps.
Peace...
Re : Re: TextDraw Problem ! -
Yaszine - 29.01.2011
Quote:
Originally Posted by Stigg
TextDrawShowForPlayer Perhaps.
Peace...
|
How can I place it under OnGameModeInit ?!
Re : TextDraw Problem ! -
Yaszine - 29.01.2011
I have tested TextDrawShowForPlayer but nothing shown !
Re : TextDraw Problem ! -
Yaszine - 29.01.2011
SomeOne ?
Re : TextDraw Problem ! -
Yaszine - 29.01.2011
Please Urgent !