Doing my Headin Textdraw Speedo (Fuel System)
#1

Alright,

So ive got no idea wtf is going on..
this is my first ever attempt with textdraws and filterscripts.
so yes, im not good - but im tryying to learn myself, anyways...

now, im not entirley sure why on fucking earth this gay arse Petrol: 100 thingo comes up.
(sorry but im that fustrated).

Код:
public sPetrol()
{
    for(new i=0;i<gMVehicles;i++)
		{
        if (IsCarRefueling[i]) continue; //stop when a player is already refuelling
        new VehicleIdentificationNumber = GetPlayerVehicleID(i); //getting vehicle ID
        if (GetPlayerVehicleSeat(i) == 0)
			{
            Petrol[VehicleIdentificationNumber] = Petrol[VehicleIdentificationNumber] -1; //lowering fuel value
            if (Petrol[VehicleIdentificationNumber]<1) //if fuel is empty
            {
                Petrol[VehicleIdentificationNumber] = 0; //setting fuel to 0 (else the timer will set it to -1 -2 -3 etc before removing player)
                RemovePlayerFromVehicle(i); //remove player out of vehicle
                GameTextForPlayer(i,"~r~You are out of ~w~fuel~r~!",5000,4); //show text
            }
        }
       
        new string[125];format(string,sizeof string,"Petrol:%i",Petrol[VehicleIdentificationNumber]); //preparing string with next fuel value //The Petrol:%i Here acutally is this 'Petrol: 100' out of place on the textdraw?

        TextDrawSetString(gPetrol[i],string); //updating textdraw
    }
    return 1;
}


public Refueling_Timer(playerid)
{
    new VehicleIdentificationNumber = GetPlayerVehicleID(playerid);
    Petrol[VehicleIdentificationNumber] = Petrol[VehicleIdentificationNumber] = 100;
    IsCarRefueling[playerid] = 0;
	TextDrawSetString(gPetrol[playerid],"Petrol:100");
    TogglePlayerControllable(playerid,1);
}
Now the white textdraw that is out of place displaying 'Petrol: 100',
this is where A: I Dont know where the flying fuck it gets its co-ords from.
B: I Have no co-ords set to their.
ive screwed around with this for about 6 hours on & off.
but i just can't figure it out, can anybody help me?

if you need more code shown just ask.



Cheers,
Reply
#2

Bump REALLY NEED HELP
Reply
#3

Try This:
Код:
public sPetrol()
{
    for(new i=0;i<gMVehicles;i++)
		{
        if (IsCarRefueling[i]) continue; //stop when a player is already refuelling
        new VehicleIdentificationNumber = GetPlayerVehicleID(i); //getting vehicle ID
        if (GetPlayerVehicleSeat(i) == 0)
			{
            Petrol[VehicleIdentificationNumber] = Petrol[VehicleIdentificationNumber] -1; //lowering fuel value
            if (Petrol[VehicleIdentificationNumber]<1) //if fuel is empty
            {
                Petrol[VehicleIdentificationNumber] = 0; //setting fuel to 0 (else the timer will set it to -1 -2 -3 etc before removing player)
                RemovePlayerFromVehicle(i); //remove player out of vehicle
                GameTextForPlayer(i,"~r~You are out of ~w~fuel~r~!",5000,4); //show text
            }
        }
       
        new string[125];format(string,sizeof string,"Petrol:%i",Petrol[VehicleIdentificationNumber]); //preparing string with next fuel value //The Petrol:%i Here acutally is this 'Petrol: 100' out of place on the textdraw?

        TextDrawSetString(gPetrol[i],string); //updating textdraw
    }
    return 1;
}


public Refueling_Timer(playerid)
{
    new VehicleIdentificationNumber = GetPlayerVehicleID(playerid);
    Petrol[VehicleIdentificationNumber] = Petrol[VehicleIdentificationNumber] = 100;
    IsCarRefueling[playerid] = 0;
    TogglePlayerControllable(playerid,1);
}
Reply
#4

Still no Luck, but thanks alot.
STILL Doing exactly the same thing grr
Reply
#5

what about this, Try it.
Код:
public sPetrol()
{
    for(new i=0;i<gMVehicles;i++)
		{
        if (IsCarRefueling[i]) continue; //stop when a player is already refuelling
        new VehicleIdentificationNumber = GetPlayerVehicleID(i); //getting vehicle ID
        if (GetPlayerVehicleSeat(i) == 0)
			{
            Petrol[VehicleIdentificationNumber] = Petrol[VehicleIdentificationNumber] -1; //lowering fuel value
            if (Petrol[VehicleIdentificationNumber]<1) //if fuel is empty
            {
                Petrol[VehicleIdentificationNumber] = 0; //setting fuel to 0 (else the timer will set it to -1 -2 -3 etc before removing player)
                RemovePlayerFromVehicle(i); //remove player out of vehicle
                GameTextForPlayer(i,"~r~You are out of ~w~fuel~r~!",5000,4); //show text
            }
        }
       
        new string[125];format(string,sizeof string,"Petrol:%i",Petrol[VehicleIdentificationNumber]); //preparing string with next fuel value //The Petrol:%i Here acutally is this 'Petrol: 100' out of place on the textdraw?

        TextDrawSetString(gPetrol[i],string); //updating textdraw
    }
    return 1;
}


public Refueling_Timer(playerid)
{
    new VehicleIdentificationNumber = GetPlayerVehicleID(playerid);
    Petrol[VehicleIdentificationNumber] = Petrol[VehicleIdentificationNumber] = ;
    IsCarRefueling[playerid] = 0;
    TogglePlayerControllable(playerid,1);
}
Reply
#6

Petrol[VehicleIdentificationNumber] = ; (Assumed zero) or whatever the error is, so...

got no idea ay.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)