Speedmeter is only showing for ID 0[++rep]
#1

The textdraw is only showing for ID 0 How to fix that

pawn Код:
forward Speedo(playerid);
public Speedo(playerid) {

    new vehicleid,
        Float:speed_x,
        Float:speed_y,
        Float:speed_z,
        Float:final_speed,
        speed_string[256],
        final_speed_int;

foreach(Player, i)
    {
        vehicleid = GetPlayerVehicleID(i);

        if(vehicleid != 0) {

            GetVehicleVelocity(vehicleid, speed_x, speed_y, speed_z);
            final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*125;
            final_speed_int = floatround(final_speed,floatround_round);
            format(speed_string,256,"Speed: %i Km/H",final_speed_int);
            PlayerTextDrawSetString(i,Speedoo[i], speed_string);
            PlayerTextDrawShow(playerid, Speedoo [ playerid ] );
            PlayerTextDrawShow(playerid, carhealth [ playerid ] );
            PlayerTextDrawShow(playerid, dashboard [ playerid ] );

        } else {

            PlayerTextDrawSetString(i,Speedoo[i], "Speed: 0 Km/H ");
            PlayerTextDrawSetString(i,carhealth[i], "Health: 1000");
            PlayerTextDrawHide(playerid,Speedoo[playerid]);
            PlayerTextDrawHide(playerid, carhealth [playerid] );
            PlayerTextDrawHide(playerid, dashboard [ playerid ] );

        }


    }
    return 1;
}
Reply


Messages In This Thread
Speedmeter is only showing for ID 0[++rep] - by lulo356 - 22.10.2014, 00:07
Re: Speedmeter is only showing for ID 0[++rep] - by DeStunter - 22.10.2014, 00:12
Re: Speedmeter is only showing for ID 0[++rep] - by lulo356 - 22.10.2014, 00:20

Forum Jump:


Users browsing this thread: 1 Guest(s)