Question regarding two different commands, not showing properly
#3

Quote:
Originally Posted by AndySedeyn
View Post
Firstly, you'll have to create an extra variable to store the number parameter in and then use it in the dialog.
Secondly, you shouldn't link tables through the name, but rather through their ID - It's the primary key of the user's table. The reason for that is because the ID is not likely to change after creating it and also because it is more efficient scanning through integers than it is through strings. I advise you to make it AUTO_INCREMENT too, if it wasn't already.
It is A_I, and yes I know. Problem is that the whole gamemode is pretty much based on playernames now. Will try to change that eventually. Testing with variables now.

Update: The dialog still doesn't show up. This is what I did:
At the "create" string:
Code:
SetIntVar(playerid, "APBNumber", number);
		if(sscanf(params,"{s[64]}d",number)) return SyntaxMSG(playerid, "/apb create [number]");
		if(ApbInfo[number][apbOn]) return SCM(playerid, COLOR_GREY, "This APB already exists.");
		Dialog_Show(playerid, APBCreate, DIALOG_STYLE_INPUT, "APB Creation", "", "Submit", "Cancel");
The actual dialog:
Code:
Dialog:APBCreate(playerid, response, listitem, inputtext[])
if(response)
	{
		new number, charge[256];
		if(strlen(inputtext) < 7 || strlen(inputtext) > 100) return Dialog_Show(playerid, APBCreate, DIALOG_STYLE_INPUT, "APB Creation", "The APB must contain between 3-100 characters", "Submit", "Cancel");
		number = GetIntVar(playerid, "APBNumber");
		SCMEx(playerid, COLOR_LIGHTRED, "You have created APB number: %d.", number);
		ApbInfo[number][apbCharge], 256, "%s", inputtext);
		ApbInfo[number][apbOfficer] = GetNameEx(playerid);
		ApbInfo[number][apbPage] = number;
		ApbInfo[number][apbID] = number;
		ApbInfo[number][apbOn] = 1;
		OnApbCreate(number, ApbInfo[number][apbCharge], GetNameEx(playerid));
		RemoveVar(playerid, "APBNumber");
	}
.. and after compiling it seems like that is not how you use a variable.
Reply


Messages In This Thread
Question regarding two different commands, not showing properly - by TheBigFive - 03.08.2016, 08:59
Re: Question regarding two different commands, not showing properly - by AndySedeyn - 03.08.2016, 09:04
Re: Question regarding two different commands, not showing properly - by TheBigFive - 03.08.2016, 09:22

Forum Jump:


Users browsing this thread: 2 Guest(s)