Speedometer only works for ID 0
#3

pawn Код:
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,"%i MPH",final_speed_int);
            TextDrawSetString(Speedometer[i], speed_string);

        } else {

            TextDrawSetString(Speedometer[i], " ");

        }


    }
    return 1;
}
If you don't use foreach replace it with
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
Reply


Messages In This Thread
Speedometer only works for ID 0 - by quagga - 13.06.2012, 15:15
Re: Speedometer only works for ID 0 - by waxhunter - 13.06.2012, 15:21
Re: Speedometer only works for ID 0 - by JhnzRep - 13.06.2012, 15:22
Re: Speedometer only works for ID 0 - by quagga - 14.06.2012, 06:16

Forum Jump:


Users browsing this thread: 1 Guest(s)