SA-MP Forums Archive
Help with texdraw change - 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)
+--- Thread: Help with texdraw change (/showthread.php?tid=286519)



Help with texdraw change - boyan96 - 29.09.2011

can you help me i wont to changethe textdraw
this is the code of the textdraw which i wont to change
PHP код:
public Speedometer()
{
    new 
vehicleidFloat:health;
    new 
enginelightsalarmdoorsbonnetbootobjective;
    new 
fstring[32], string[512];
    for(new 
i=0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
        {
            
vehicleid GetPlayerVehicleID(i);
            
GetVehicleHealth(vehicleidhealth);
            
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
            
            
string "~b~~h~vehicle: ~w~";
            
strcat(stringVehicleNames[GetVehicleModel(vehicleid)-400], sizeof(string));
            
            
strcat(string"~n~~b~~h~gps: ~w~"sizeof(string));
            
strcat(stringGetPlayer3DZone(i), sizeof(string));
            
            
strcat(string"~n~~b~~h~health: ~g~"sizeof(string));
            
fstring "iiiiiiiiii";
            if(
health 1000.0strins(fstring"~r~"10sizeof(fstring));
            else if(
health 0.0strins(fstring"~r~"0sizeof(fstring));
            else 
strins(fstring"~r~"floatround(health/100.0), sizeof(fstring));
            
strcat(stringfstringsizeof(string));
            
            
strcat(string"        ~b~~h~fuel: ~g~"sizeof(string));
            
fstring "iiiiiiiiii";
            if(
Fuel[vehicleid] > 100.0strins(fstring"~r~"10sizeof(fstring));
            else if(
Fuel[vehicleid] < 0.0strins(fstring"~r~"0sizeof(fstring));
            else 
strins(fstring"~r~"floatround(Fuel[vehicleid]/10.0), sizeof(fstring));
            
strcat(stringfstringsizeof(string));
            
            
strcat(string"        ~b~~h~"sizeof(string));
            if(
GetPVarInt(i"Speedo")) format(fstring,sizeof(fstring),"mph: ~w~%d"GetPlayerSpeed(ifalse));
            else 
format(fstring,sizeof(fstring),"kph: ~w~%d"GetPlayerSpeed(itrue));
            
strcat(stringfstringsizeof(string));
            
            
strcat(string"~n~~b~~h~engine: "sizeof(string));
            if(
engine == 1strcat(string"~g~on"sizeof(string));
            else 
strcat(string"~r~off"sizeof(string));
            
            
strcat(string"        ~b~~h~alarm: "sizeof(string));
            if(
VehicleSecurity[vehicleid] == 1strcat(string"~g~on"sizeof(string));
            else 
strcat(string"~r~off"sizeof(string));
            
            
strcat(string"        ~b~~h~doors: "sizeof(string));
            if(
doors == 1strcat(string"~r~locked"sizeof(string));
            else 
strcat(string"~g~unlocked"sizeof(string));
            
            
TextDrawSetString(SpeedoText[i], string);
        }
    }

PHP код:
public OnFilterScriptInit()
{
    print(
"\n------------------------------------------------");
    print(
"      Vehicle System");
    print(
"------------------------------------------------");
    
    
    
SpeedoBox TextDrawCreate(345.000363.000"~n~~n~~n~~n~");
    
TextDrawAlignment(SpeedoBox2);
    
TextDrawLetterSize(SpeedoBox0.5001.400);
    
TextDrawUseBox(SpeedoBox1);
    
TextDrawBoxColor(SpeedoBox153);
    
TextDrawTextSize(SpeedoBox0.000340.000); 
PHP код:
public OnPlayerConnect(playerid)
{
    
    
SpeedoText[playerid] = TextDrawCreate(180.000362.000," ");
    
TextDrawAlignment(SpeedoText[playerid], 1);
    
TextDrawFont(SpeedoText[playerid],2);
    
TextDrawLetterSize(SpeedoText[playerid], 0.3101.400);
    
TextDrawSetShadow(SpeedoText[playerid],0);
    return 
1;

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    
TextDrawDestroy(SpeedoText[playerid]);
    return 
1;

this all to make it with this textdraw
Код HTML:
<<<@!5!@>>>