18.10.2011, 11:55
Hi,
so i have a fuel system :
And i want the fuel to be showd in TextDraw format not GameText. I have tried to change it but no succes ... i'm not so good at TextDraw If someone know how to to it please help me .
Sorry for my bad english.
so i have a fuel system :
pawn Код:
public CheckGas()
{
new string[256];
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(i);
if(Gas[vehicle] >= 1)
{
if(Gas[vehicle] <= 10) { PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0); }
if(gGas[i] == 1)
{
format(string, sizeof(string), "~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~Benzina:~w~ %d%",Gas[vehicle]);
GameTextForPlayer(i,string,15500,3);
}
if(IsAPlane(vehicle) || IsABoat(vehicle)) { Gas[vehicle]++; }
Gas[vehicle]--;
}
else
{
NoFuel[i] = 1;
TogglePlayerControllable(i, 0);
GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~No fuel in Vehicle~n~Use /exit to leave the vehicle",1500,3);
}
}
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/fuel", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gGas[playerid] == 0)
{
gGas[playerid] = 1;
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~p~Fuel Info on", 5000, 5);
TextDrawShowForPlayer(playerid,text199);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
}
else if (gGas[playerid] == 1)
{
gGas[playerid] = 0;
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~b~Fuel Info off", 5000, 5);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
}
return 1;
}
}
Sorry for my bad english.