[FilterScript] mVelocimetro v1.0 (0.3e)
#8

pawn Код:
//
    SetTimer("Velocimetro", 1, 1);    
//
public Velocimetro(){
    new Float:VehicleHP;
    for(new i = 0; i < MAX_PLAYERS; i++){
        new vehicleid = GetPlayerVehicleID(i);        
        new _str[256];        
        GetVehicleHealth(vehicleid, VehicleHP);        
        format(_str, sizeof(_str), "~b~~>~Veiculo:~w~ %s~n~~b~~>~Velocidade:~w~ %d KM/h~n~~b~~>~Combustivel: ~W~%d%%~n~~b~~>~Lataria: ~W~%0.0f%%~n~~b~~>~Blindagem: ~W~%d%%~n~~b~~>~Localizacao:~w~ %s", vehName[GetVehicleModel(vehicleid)-400], GetPlayerSpeed(i, true), Gasolina[vehicleid], VehicleHP/10, Blindagem[vehicleid], ReturnPlayerZone(i));
        TextDrawSetString(Speedometer[i], _str);        
    }  
}
Primeiro que nгo й necessбrio esse settimer global de 1 milisegundo de atualizaзгo, e pra que usar loop quando pode - se usar playerid, exemplo,

pawn Код:
new
    TimerSpeed[MAX_PLAYERS]
;


public OnPlayerConnect(playerid)
{
    TimerSpeed[playerid] = SetTimerEx("Velocimetro", 100, true, "d", playerid);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    KillTimer(TimerSpeed[playerid]);
    return 1;
}

public Velocimetro(playerid)
{
    new Float:VehicleHP;
    new vehicleid = GetPlayerVehicleID(playerid);        
    new _str[256];        
    GetVehicleHealth(vehicleid, VehicleHP);        
    format(_str, sizeof(_str), "~b~~>~Veiculo:~w~ %s~n~~b~~>~Velocidade:~w~ %d KM/h~n~~b~~>~Combustivel: ~W~%d%%~n~~b~~>~Lataria: ~W~%0.0f%%~n~~b~~>~Blindagem: ~W~%d%%~n~~b~~>~Localizacao:~w~ %s", vehName[GetVehicleModel(vehicleid)-400], GetPlayerSpeed(playerid, true), Gasolina[vehicleid], VehicleHP/10, Blindagem[vehicleid], ReturnPlayerZone(playerid));
    TextDrawSetString(Speedometer[playerid], _str);        
    return 1;  
}
Reply


Messages In This Thread
mVelocimetro v2.0 - Atualizado!! - by MegaStyle157 - 20.03.2013, 12:30
Re: mVelocimetro v1.0 (0.3e) - by iFox - 20.03.2013, 13:35
Re: mVelocimetro v1.0 (0.3e) - by Jumper. - 20.03.2013, 13:44
Re: mVelocimetro v1.0 (0.3e) - by MegaStyle157 - 20.03.2013, 14:10
Re: mVelocimetro v1.0 (0.3e) - by Sky™ - 20.03.2013, 14:24
Re: mVelocimetro v1.0 (0.3e) - by zSuYaNw - 20.03.2013, 14:36
Re: mVelocimetro v1.0 (0.3e) - by VenoN - 20.03.2013, 14:37
Re: mVelocimetro v1.0 (0.3e) - by Maklister - 20.03.2013, 15:48
Re: mVelocimetro v1.0 (0.3e) - by Lуs - 20.03.2013, 16:28
Re: mVelocimetro v1.0 (0.3e) - by LuxuN - 20.03.2013, 16:28

Forum Jump:


Users browsing this thread: 2 Guest(s)