09.06.2013, 15:37
Coloque em OnGameModeInit em vez de OnPlayerConnect
pawn Код:
new TemVelo[MAX_PLAYERS] = 0;
if(TemVelo[playerid] == 1)
{
velo[playerid] = TextDrawCreate(-16,300, " ");
TextDrawBackgroundColor(velo[playerid], 0x000000FF);
TextDrawColor(velo[playerid], 0xFFFFFFFF);
TextDrawSetOutline(velo[playerid], 1);
TextDrawFont(velo[playerid], 1);
TextDrawHideForPlayer(playerid, velo[playerid]);
return 1;
}
}
public Velocimetro()
{
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(i, aname, MAX_PLAYER_NAME);
if(IsPlayerInAnyVehicle(i)) {
new Float:X, Float:Y, Float:Z, Float:Speed;
GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)), floatpower(Z, 2))), 129.0);
new velocid;
velocid = floatround(Speed, floatround_floor);
new string[256];
new PlayerVehicleModelID = GetVehicleModel(GetPlayerVehicleID(i));
PlayerVehicleModelID -= 400;
dini_IntSet(file, "Velocimetro1", 1);
format(string, 256,"~n~ ~b~ %i ~w~KM/H",velocid);
TextDrawSetString(velo[i],string);
TextDrawShowForPlayer(i,velo[i]);
} else TextDrawHideForPlayer(i, velo[i]);
}
else {
TextDrawHideForPlayer(i, velo[i]);
}
}
}