24.02.2014, 22:04
I am doing a tutorial on a fuel system, and i got no errors or warnings( i have been adding from a tutorial to my gamemode), and when i enter a vehicle, i get the login screen textdraw..
This is what i have when a player enters a vehicle:
This is what i beleave is the main menu textdraw, it is called OnPlayerLoggin, and thats where it comes when i see it.
EDIT: here is also the news:
I dont see why this would happen. Why the "stock ShowMainMenuGUI"? I am new to textdraw, and not very good at scripting, so please explain carefully. Thanks!
This is what i have when a player enters a vehicle:
pawn Код:
if (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
new vid = GetPlayerVehicleID(playerid);
new string[125];format(string,sizeof string,"Fuel:%i",fuel[vid]); //quickly doing a small update on fuel (so it wont jump from 100 to its real value)
TextDrawSetString(td_fuel[playerid],string);
TextDrawShowForPlayer(playerid,td_fuel[playerid]); //showing if an player is a driver or passenger of the ar
} else {
TextDrawHideForPlayer(playerid,td_fuel[playerid]); //hiding if a player isnt driving/or an passenger
}
pawn Код:
stock ShowMainMenuGUI(playerid) {
InsideMainMenu[playerid] = 1;
new string[22];
format(string, sizeof(string), "Players online: %d", Iter_Count(Player));
TextDrawSetString(MainMenuTxtdraw[7], string);
for(new i = 0; i < 12; i++) {
TextDrawShowForPlayer(playerid, MainMenuTxtdraw[i]);
}
return 1;
}
pawn Код:
new fuel[MAX_VEHICLES]; //fuel per vehicle
forward timer_fuel_lower(); //timer for lowering the fuel value
forward timer_refuel(playerid); //timer to refuel vehicle
new isrefuelling[MAX_PLAYERS] = 0; //bool to check if player is already refuelling
new Text:td_fuel[MAX_PLAYERS]; //textdraw with fuel