28.01.2011, 23:18
(
Последний раз редактировалось Yaszine; 30.01.2011 в 13:43.
)
Hello everyone
So, I have UpdateSpeedo(); OnPlayerConnect
This is it:
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
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);
}
}
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