25.03.2013, 04:10
My OnDialogResponse won't call for any of my dialogs that i'm using in my FS.
Nothing is printed when I use the CMD '/tagwall'.
The CMD:
Nothing is printed when I use the CMD '/tagwall'.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
print("dialog 1 called");
if(response)
{
Tagging[playerid] = 1;
if(listitem == 0)
{
print("listitem 0 called");
TagMode[playerid] = 1;
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Select a Color", "{FFFFFF}Sample\n{BF4000}Sample\n{FF0000}Sample\n{FFFF00}Sample\n{7CFC00}Sample\n{00BFFF}Sample\n{FF6347}Sample\n{FF9933}Sample", "Next", "Exit");
}
if(listitem == 1)
{
print("listitem 1 called");
TagMode[playerid] = 2;
SelectObject(playerid);
}
if(listitem == 2)
{
print("listitem 3 called");
TagMode[playerid] = 3;
SelectObject(playerid);
}
}
}
if(dialogid == 2)
{
print("dialog 2 called");
if(response)
{
TagColor[playerid] = listitem;
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Name of Tag", "Please enter what you want your tag to be!", "Next", "Exit");
}
}
if(dialogid == 3)
{
print("dialog 3 called");
if(response)
{
if(strlen(inputtext) < 1 || strlen(inputtext) > 16) return SendClientMessage(playerid, 0xFF0000AA, "Tag canceled: Too short, or long of tag.");
new Float:p[3];
GetPlayerPos(playerid, p[0], p[1], p[2]);
new ob = CreateObject(0, p[0], p[1]+1, p[2], 0, 0, 0, 0);
SetObjectMaterialText(ob, inputtext, 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 24, 1, Colors[TagColor[playerid]], 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
SelectObject(playerid);
}
}
return 0;
}
pawn Код:
CMD:tagwall(playerid)
{
if(GetPlayerWeapon(playerid) != 41) return SendClientMessage(playerid, 0xFF0000AA, "You must have a spray can!");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Select an Option", "Create a Tag\nEdit a Tag\nDelete a Tag", "Next", "Exit");
return 1;
}