Dialog error :@ -
Private200 - 01.11.2012
Guys , i need some help .
I am creating a AFK / Back filterscript , but an weapon FS too , witch should have finish till yesterday .
But i don't get any error , no warnings , when i join game and do the cmd , ( /weapons ) example , the dialog appears , but when i chose one of them , nothing happends .
Help please
Re: Dialog error :@ -
silenthill - 01.11.2012
Posta ae mano
Re: Dialog error :@ -
SwisherSweet - 02.11.2012
code please.
Re: Dialog error :@ -
Private200 - 02.11.2012
I have a problem with the pc now , i am formating it , and when i finish i tell you so ... Wait a little bit
Ok , now i formated pc .
Here codes of the dialog are :
PHP код:
if(response)// They pressed the first button.
{
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 35:// Our dialog! I made it this number , so it don't mess with other dialogs in your gamemode!
{
switch(listitem)// Checking which listitem was selected
{
case 0:// The first item listed
{
new pname[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s gone AFK!", pname);
SendClientMessageToAll(pink, string);
TogglePlayerControllable(playerid, 0);
}
case 1: // The second item listed
{
new pname[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s came Back from AFK!", pname);
SendClientMessageToAll(pink, string);
TogglePlayerControllable(playerid, 1);
}
}
}
}
}
return 1;
}
And warnings + errors here :
Код:
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
No warnings , no errors
AW: Dialog error :@ -
Skimmer - 02.11.2012
Show me your
ShowPlayerDialog function
Re: Dialog error :@ -
HyDrAtIc - 02.11.2012
pawn Код:
if(response)// They pressed the first button.
{
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 35:// Our dialog! I made it this number , so it don't mess with other dialogs in your gamemode!
{
switch(listitem)// Checking which listitem was selected
{
case 0:// The first item listed
{
new pname[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s gone AFK!", pname);
SendClientMessageToAll(pink, string);
TogglePlayerControllable(playerid, 0);
}
case 1: // The second item listed
{
new pname[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s came Back from AFK!", pname);
SendClientMessageToAll(pink, string);
TogglePlayerControllable(playerid, 1);
}
}
}
}
}
return 1;
}
Please use [pawn] tags next time
Re: Dialog error :@ -
Private200 - 02.11.2012
Here ShowPlayerDialog is
pawn Код:
COMMAND:ab(playerid, params[])
{
ShowPlayerDialog(playerid, 35, DIALOG_STYLE_LIST, "What you want to do?", "Go AFK \nCome Back", "Chose", "Cancel");
return 1;
}
AW: Dialog error :@ -
Skimmer - 02.11.2012
Why you don't use as
DIALOG_STYLE_MSGBOX ?
Define this top of the script
pawn Код:
COMMAND:ab(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_AFK, DIALOG_STYLE_MSGBOX, "AFK System", "What you want to do?", "AFK", "BACK");
return 1;
}
pawn Код:
if(dialogid == DIALOG_AFK)
{
if(response)
{
new pname[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s gone AFK!", pname);
SendClientMessageToAll(pink, string);
TogglePlayerControllable(playerid, 0);
}
else
{
new pname[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s came Back from AFK!", pname);
SendClientMessageToAll(pink, string);
TogglePlayerControllable(playerid, 1);
}
}