Dialog error :@
#1

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
Reply
#2

Posta ae mano
Reply
#3

code please.
Reply
#4

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(playeridpnameMAX_PLAYER_NAME);
                         
format(stringsizeof(string), "%s gone AFK!"pname);
                         
SendClientMessageToAll(pinkstring);
                        
TogglePlayerControllable(playerid0);
                 }
                case 
1// The second item listed
                
{
                        new 
pname[MAX_PLAYER_NAME];
                        new 
string[128];
                        
GetPlayerName(playeridpnameMAX_PLAYER_NAME);
                        
format(stringsizeof(string), "%s came Back from AFK!"pname);
                        
SendClientMessageToAll(pinkstring);
                        
TogglePlayerControllable(playerid1);
                }
            }
            }
    }
    }
return 
1;

And warnings + errors here :

Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
No warnings , no errors
Reply
#5

Show me your ShowPlayerDialog function
Reply
#6

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
Reply
#7

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;
}
Reply
#8

Why you don't use as DIALOG_STYLE_MSGBOX ?

Define this top of the script
pawn Код:
#define DIALOG_AFK 35
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);
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)