PDA

View Full Version : Need help. My dialog will not work???


Lynet
11/09/2013, 03:05 PM
Hello. I have a problem with my dialog.

All my dialogs works in my test server. But then i send the files to my volt server. And loaded the filterscript. will it not work.

But the dialog come up. But i cant select a weapon. I only close down again and again when i try to select a weapon???

What is wrong. A loaded plugin?or

Dialog...

#define DIALOG_LOCKER 5
#define DIALOG_BUYWEAPONS 7


if(!strcmp(cmdtext, "/buyweapon", true))
{
if(PlayerToPoint(20.0,playerid,2442.8718,-1973.7949,13.5469))
ShowPlayerDialog(playerid, DIALOG_BUYWEAPONS, DIALOG_STYLE_LIST, "Weapon list and Price", "Colt45. 750$\nDeagle 1250$\nShotgun 1750$\nSpas-12 5750$ Only O.G mission level 2 and higher\nAK-47 3750$\nM4-A1 5750$ Only O.G mission level 2 and higher\nMolotovs 7500$ Only O.G mission level 4 and higher\nRocket 12.750$ Only O.G mission level 6 the highest level.", "Select", "Canel");
else SendClientMessage(playerid, 0xAA3333AA, "[Error]: {FFFFFF} You are not near the ammo place");
return 1;
}
if(!strcmp(cmdtext, "/Lockers", true))
{
new Skin;
Skin = GetPlayerSkin(playerid);
if(Skin == 71||Skin == 281||Skin == 267||Skin == 280||Skin == 282||Skin == 288||Skin == 165||Skin == 166||Skin == 284||Skin == 285||Skin == 286||Skin == 287||Skin == 283)
if(PlayerToPoint(20.0,playerid,254.1121,74.1638,10 03.6406))
ShowPlayerDialog(playerid, DIALOG_LOCKER, DIALOG_STYLE_LIST, "Weapons and Clothes", "Cadet Cloth\nOfficer | Cloth\nOfficer || Cloth\nOfficer ||| Cloth\nLSPD Motorbike Cop\nS.W.A.T Special Forces", "Select", "Close");
else SendClientMessage(playerid, 0xAA3333AA, "[Error]: {FFFFFF} You are not around a control pad!");
return 1;
}
return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_BUYWEAPONS)
{
if(response) // If they clicked 'Select' or double-clicked a weapon
{
// Give them the weapon
if(listitem == 0) // They selected the first item - Desert Eagle
{
GivePlayerWeapon(playerid, 22, 150); // Give them a desert eagle
}
if(listitem == 1) // They selected the second item - AK-47
{
GivePlayerWeapon(playerid, 24, 150); // Give them an AK-47
}
if(listitem == 2) // They selected the third item - Desert Eagle if(GetPlayerWantedLevel(playerid) >= 2)
{
GivePlayerWeapon(playerid, 25, 150);
}
if(listitem == 3) // They selected the second item - AK-47
{
if(GetPlayerWantedLevel(playerid) >= 2) GivePlayerWeapon(playerid, 27, 150); // Give them an AK-47
}
if(listitem == 4) // They selected the second item - AK-47
{
GivePlayerWeapon(playerid, 30, 150); // Give them an AK-47
}
if(listitem == 5) // They selected the second item - AK-47
{
if(GetPlayerWantedLevel(playerid) >= 2) GivePlayerWeapon(playerid, 31, 150); // Give them an AK-47
}
if(listitem == 6) // They selected the second item - AK-47
{
if(GetPlayerWantedLevel(playerid) >= 4) GivePlayerWeapon(playerid, 18, 1); // Give them an AK-47
}
if(listitem == 7) // They selected the second item - AK-47
{
if(GetPlayerWantedLevel(playerid) >= 6) GivePlayerWeapon(playerid, 35, 1); // Give them an AK-47
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}

if(dialogid == DIALOG_LOCKER)
{
if(response) // If they clicked 'Select' or double-clicked a weapon
{
// Give them the weapon
if(listitem == 0) // Cadet
{
GivePlayerWeapon(playerid, 3, 1);
SetPlayerArmour(playerid, 100.0);
SetPlayerSkin(playerid, 71);
GivePlayerWeapon(playerid, 24, 150);
}
if(listitem == 1) // They selected the second item - AK-47
{
GivePlayerWeapon(playerid, 3, 1);
SetPlayerArmour(playerid, 100.0);
SetPlayerSkin(playerid, 280);
GivePlayerWeapon(playerid, 24, 150);
GivePlayerWeapon(playerid, 25, 150);
}
if(listitem == 2) // They selected the third item - Desert Eagle
{
GivePlayerWeapon(playerid, 3, 1);
SetPlayerArmour(playerid, 100.0);
SetPlayerSkin(playerid, 281);
GivePlayerWeapon(playerid, 24, 150);
GivePlayerWeapon(playerid, 25, 150);
GivePlayerWeapon(playerid, 29, 150);
}
if(listitem == 3) // They selected the third item - Desert Eagle
{
GivePlayerWeapon(playerid, 3, 1);
SetPlayerArmour(playerid, 100.0);
SetPlayerSkin(playerid, 282);
GivePlayerWeapon(playerid, 24, 150);
GivePlayerWeapon(playerid, 25, 150);
GivePlayerWeapon(playerid, 29, 150);
GivePlayerWeapon(playerid, 31, 150);
}
if(listitem == 4) // They selected the third item - Desert Eagle
{
GivePlayerWeapon(playerid, 3, 1);
SetPlayerArmour(playerid, 100.0);
SetPlayerSkin(playerid, 284);
GivePlayerWeapon(playerid, 24, 150);
}
if(listitem == 5) // They selected the third item - Desert Eagle
{
GivePlayerWeapon(playerid, 27, 750);
GivePlayerWeapon(playerid, 24, 750);
SetPlayerArmour(playerid, 100.0);
SetPlayerSkin(playerid, 285);
GivePlayerWeapon(playerid, 31, 750);
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}

DanishHaq
11/09/2013, 03:06 PM
It'd help if you show us the dialog's... and OnPlayerDialogResponse

Konstantinos
11/09/2013, 03:09 PM
Does OnDialogResponse return 0 at the end of the callback?

Lynet
11/09/2013, 03:10 PM
Here. I have replaced it...

I dont know it. My test server runs on my windows 7 pc.

And my Volt server runs on a Linux???

Konstantinos
11/09/2013, 03:16 PM
Is the code above from the filterscript? Make sure that you don't use dialogid 5 and 7 anywhere else (in other mode).

Lynet
11/09/2013, 03:18 PM
What did you mean???

Like

#define DIALOG_LOCKER
#define DIALOG_BUYWEAPONS

Removed the 5 and 7?

Dragonsaurus
11/09/2013, 03:37 PM
Just redefine them to some other numbers, change 5 and 7 to something like 1005, 2007.