Jump to content
  • 0

Problema speed&fuel&odometer


Joel

Question

Nick: Joel

Problema: Nu pot sa imi dau seama de ce se vede asa marit.

Erori / warnings: Nu imi da nicio eroare la compilare, dar totusi se vede asa marit (nu e de la rezolutie si nu o patesc doar eu)

fuel_problem.png

Lini/script:

public Checkvehinfo()
{
    foreach(Player,i)
    {
    	if(IsPlayerConnected(i))
       	{
       	    if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
       	    {
           		new vehicle = GetPlayerVehicleID(i);
                new spe = Carspeed(i);
                new str1[128],str2[128],str3[128];
                TextDrawShowForPlayer(i, Speedd[i]);
                format(str1,sizeof(str1)," Speed: %d Km/h",spe);
                TextDrawSetString(Speedd[i], str1);
                if(!IsABike(vehicle))
                {
                    TextDrawShowForPlayer(i, Fuell[i]);
                    format(str2,sizeof(str2)," Fuel: %d%", Gas[vehicle]);
                    TextDrawSetString(Fuell[i], str2);
                }
                if(OwnedVeh(vehicle) != 0 && !IsAPlane(vehicle))
                {
                    TextDrawShowForPlayer(i, Odom[i]);
                    format(str3,sizeof(str3),"Odometers: %.2f Km",CarInfo[OwnedVeh(vehicle)][cKM]);
                    TextDrawSetString(Odom[i], str3);
                }
            }
    	}
    }
    return 1;
}

Ai incercat sa rezolvi singur ?: De 4 ore ma tot chinui sa gasesc o rezolvare..

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Salut,inafara de asta mai ai alt ceva cu Fuel?

Daca nu incearca asta:

public Checkvehinfo()
{
    foreach(Player,i)
    {
    	if(IsPlayerConnected(i))
       	{
       	    if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
       	    {
           		new vehicle = GetPlayerVehicleID(i);
                new spe = Carspeed(i);
                new str1[128],str2[128],str3[128];
                TextDrawShowForPlayer(i, Speedd[i]);
                format(str1,sizeof(str1)," Speed: %d Km/h",spe);
                TextDrawSetString(Speedd[i], str1);
                if(!IsABike(vehicle))
                {
                    TextDrawShowForPlayer(i, Fuell[i]);
                    format(str1,sizeof(str1)," Fuel: %d%", Gas[vehicle]);
                    TextDrawSetString(Fuell[i], str1);
                }
                if(OwnedVeh(vehicle) != 0 && !IsAPlane(vehicle))
                {
                    TextDrawShowForPlayer(i, Odom[i]);
                    format(str3,sizeof(str3),"Odometers: %.2f Km",CarInfo[OwnedVeh(vehicle)][cKM]);
                    TextDrawSetString(Odom[i], str3);
                }
            }
    	}
    }
    return 1;
}

Iar R0bi,el a pus %d% deoarece vrea sa ii apara Fuel X% (la suta)

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.