Textdraw strings not showing when 4+ players online
#1

I'm trying to make an /inventory command for my server, it uses 8 different strings and works fine when I test it in-game on my own. The problem is that when there are 4+ players online, the textdraw and strings work properly for 2 of the players, but when either of the other 2 players use the /inventory command the textdraw box opens but as an empty textdraw with no information/strings showing for them (they also get the Unknown Command error in the chat although the textdraw itself (without the text/strings) opens.

the TD_MENU_INFO textdraw works without problems when used in other commands such as /info but is broken for /inventory.
Does anybody have any idea what could be causing this and how to fix it? I have a feeling its a problem with the strings but my knowledge of textdraws is pretty limited

/inventory command:
Код:
COMMAND:inventory(playerid,params[])
{
    new string[512],CHstr[256],Hstr[256],Beltstr[256],Crowstr[256],Rodstr[256],Ifixstr[256],Flipstr[256];

    if (PlayerInfo[playerid][pCharm] == 0)format(CHstr, sizeof(CHstr), "~w~You Do ~r~Not ~w~Have A ~p~Lucky Charm");else format(CHstr, sizeof(CHstr), "~g~You Have A ~p~Lucky Charm");
	if (PlayerInfo[playerid][pHealthIns] > 0)format(Hstr, sizeof(Hstr), "~g~You Have Health Insurance");else format(Hstr, sizeof(Hstr), "~w~You Currently Do ~r~Not ~w~Have ~p~Health Insurance");
	if (PlayerInfo[playerid][pChastityBelt] == 0) format(Beltstr, sizeof(Beltstr),"~r~No");else format(Beltstr, sizeof(Beltstr),"~g~Yes");
	if (PlayerInfo[playerid][pCrowbar] == 0) format(Crowstr, sizeof(Crowstr),"~r~No");else format(Crowstr, sizeof(Crowstr),"~g~Yes");
	if (PlayerInfo[playerid][pFishingRod] == 0) format(Rodstr, sizeof(Rodstr),"~r~No");else format(Rodstr, sizeof(Rodstr),"~g~Yes");
	if (PlayerInfo[playerid][TrackKit] == 0) format(Ifixstr, sizeof(Ifixstr),"~r~No");else format(Ifixstr, sizeof(Ifixstr),"~g~Yes");
	if (PlayerInfo[playerid][FlipKit] == 0) format(Flipstr, sizeof(Flipstr),"~r~No");else format(Flipstr, sizeof(Flipstr),"~g~Yes");

    HideTextDrawMenu(playerid);

	ShowTextDrawMenu(playerid, TD_MENU_INFO,"~y~INVENTORY", 24, 0);//   pet   ins              //charm                       //belt         //condoms             //crowbar                 //fish                 //Rod                                    //ifix        //Repair kit         //flipkit     /credits
	format(string, sizeof(string), "~n~Cash: ~g~$%d  ~w~Bank: ~g~$%d~n~~n~~w~Pet: ~p~%s~n~~n~%s~n~~n~~w~%s~n~~n~~w~Chastity Belt: %s~n~~w~Adrenaline Pills: ~p~%d ~n~~w~~w~Condoms ~p~%d ~n~~n~~w~Fishing Rod: ~p~%s~n~~w~Fish: ~p~%d~n~~n~~w~Crowbar: ~p~%s~n~~w~InstaFix: %s ~n~~w~Flip Kit: %s ~n~~w~Repair Kits: ~p~%d~n~~w~Vehicle Credits: ~p~%d~n~~n~~w~You Are Carrying ~g~%d Grams ~w~Of Drugs",

	GetPlayerCash(playerid),
	PlayerInfo[playerid][pBank],
	PetNames[PlayerInfo[playerid][pPet]],
	Hstr,
	CHstr,
	Beltstr,
	PlayerInfo[playerid][pPills],
	PlayerInfo[playerid][pCondom],
	Rodstr,
	PlayerInfo[playerid][pFishes],
	Crowstr,
	Ifixstr,
	Flipstr,
	PlayerInfo[playerid][FixKit],
	PlayerInfo[playerid][pVehCredit],
	PlayerInfo[playerid][pDrugs]);


	ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
	return 1;
}
/inventory textdraw when less than 4 players online:
Reply


Messages In This Thread
Textdraw strings not showing when 4+ players online - by Ducati - 05.04.2018, 19:03
Re: Textdraw strings not showing when 4+ players online - by Mugala - 06.04.2018, 07:32
Re: Textdraw strings not showing when 4+ players online - by Ducati - 06.04.2018, 14:35
Re: Textdraw strings not showing when 4+ players online - by Mugala - 06.04.2018, 14:44
Re: Textdraw strings not showing when 4+ players online - by Ducati - 06.04.2018, 15:12

Forum Jump:


Users browsing this thread: 2 Guest(s)