03.08.2016, 09:22
Quote:
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. |
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");
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"); }