14.05.2018, 18:50
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:
And also i tryed to store killerid - id in variable, and that variable use in fDialog but again same problem.
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(playerid, killerid, reason)
{
ShowPlayerDialog(killerid, 654, DIALOG_STYLE_INPUT, "Simple question for you", "Are you smart?", "Ok", "");
return 1;
}
fDialog(654)
{
if(response)
{
if(!strlen(inputtext))
{
SCM(playerid, COLOR_GRAD1, "Dialog is Empty");
return 1;
}
if(strlen(inputtext) < 5)
{
SCM(playerid, COLOR_GRAD1, "Inputtext can't be under 5 letters");
return 1;
}
if(((!(inputtext[0])) || (((inputtext[0]) == '\1') && (!(inputtext[1])))))
{
SCM(playerid, COLOR_GRAD1, "wtf?");
return 1;
}
// other code
}
else
{
ShowPlayerDialog(playerid, 654, DIALOG_STYLE_INPUT, "Simple question for you", "Are you smart?", "Ok", "");
}
return 1;
}
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
GetKillerID[killerid] = killerid;
ShowPlayerDialog(killerid, 654, DIALOG_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], 654, DIALOG_STYLE_INPUT, "Simple question for you", "Are you smart?", "Ok", "");
}
return 1;
}