OnPlayerDeath && ShowPlayerDialog issue
#1

I have some issue with onplayerdeath and showplayerdialog. When i show dialog for killer, killer can leave dialog empty and press ok.I trying on many ways to find solution for fix, but i don't have more ideas.
When i showing this dialog for player via command YCMD, everything work fine, but when i show dialog for killer under onplayerdeath, conditions in that dialog not work.
Although they are correct

Example of code:
PHP код:
new GetKillerID[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    
GetKillerID[playerid] = 0;
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    
ShowPlayerDialog(killerid654DIALOG_STYLE_INPUT"Simple question for you""Are you smart?""Ok""");
    return 
1;
}
fDialog(654)
{
    if(
response)
    {
        if(!
strlen(inputtext))
        {
            
SCM(playeridCOLOR_GRAD1"Dialog is Empty");
             return 
1;
        }
         if(
strlen(inputtext) < 5)
          {
               
SCM(playeridCOLOR_GRAD1"Inputtext can't be under 5 letters");
             return 
1;
           }
           if(((!(
inputtext[0])) || (((inputtext[0]) == '\1') && (!(inputtext[1])))))
           {
               
SCM(playeridCOLOR_GRAD1"wtf?");
            return 
1;
           }
           
           
// other code
    
}
    else
    {
         
ShowPlayerDialog(playerid654DIALOG_STYLE_INPUT"Simple question for you""Are you smart?""Ok""");
    }
    return 
1;

And also i tryed to store killerid - id in variable, and that variable use in fDialog but again same problem.

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
GetKillerID[killerid] = killerid;
    
ShowPlayerDialog(killerid654DIALOG_STYLE_INPUT"Simple question for you""Are you smart?""Ok""");
    return 
1;
}
fDialog(654)
{
    if(
response)
    {
        
//NOT WORK
        
if(!strlen(inputtext))
        {
            
SCM(GetKillerID[playerid], COLOR_GRAD1"Dialog is Empty");
             return 
1;
        }
         if(
strlen(inputtext) < 5)
          {
               
SCM(GetKillerID[playerid], COLOR_GRAD1"Inputtext can't be under 5 letters");
             return 
1;
           }
           if(((!(
inputtext[0])) || (((inputtext[0]) == '\1') && (!(inputtext[1])))))
           {
               
SCM(GetKillerID[playerid], COLOR_GRAD1"wtf?");
            return 
1;
           }
           
//NOT WORK
           // other code WORK
    
}
    else
    {
         
ShowPlayerDialog(GetKillerID[playerid], 654DIALOG_STYLE_INPUT"Simple question for you""Are you smart?""Ok""");
    }
    return 
1;

Reply


Messages In This Thread
OnPlayerDeath && ShowPlayerDialog issue - by OsmanMalagic - 14.05.2018, 18:50
Re: OnPlayerDeath && ShowPlayerDialog issue - by CodeStyle175 - 14.05.2018, 20:27

Forum Jump:


Users browsing this thread: 1 Guest(s)