I Need Help With Dialog! Is Imported!
#1

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[256];
if(dialogid == 50 && response)
{
switch(listitem)
{
case 0:
{
if(HasMan[playerid] == 0)
{
HasMan[playerid] = 1;
SendClientMessage(playerid, -1, ".{00FF00}Work!");
}else{
HasMan[playerid] = 0;
SendClientMessage(playerid, -1, ".{FF0000}No Work!");
}
return 1;
}
case 1:
{
ShowPlayerDialog(playerid, 512, DIALOG_STYLE_INPUT, "Be Man", "Press Your Info:", "OK", "No");
return 1;
}
case 2:
{
format(string, sizeof(string), "{00FF00}%s Has WoMan", GetName(playerid));
SendClientMessageToAll(-1, string);
SetTimerEx("ManMessage", 10000, 0, "d", playerid);
return 1;
}
}

if(dialogid == 512 && response)
{
if(!strlen(inputtext)) return SendClientMessage(playerid, -1, "Your Name Please!");
SetPlayerName(playerid, inputtext);
format(string, sizeof(string), "Your New Name:", inputtext);
SendClientMessage(playerid, -1, string);
return 1;
}
}

return 0;
}
50 dialog id works, but 512 dialog id as if he does not do anything, it does not change the name and send a message
Why?! Thanks for helpers!
Reply
#2

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[256];
if(dialogid == 50 && response)
{
switch(listitem)
{
case 0:
{
if(HasMan[playerid] == 0)
{
HasMan[playerid] = 1;
SendClientMessage(playerid, -1, ".{00FF00}Work!");
}else{
HasMan[playerid] = 0;
SendClientMessage(playerid, -1, ".{FF0000}No Work!");
}
return 1;
}
case 1:
{
ShowPlayerDialog(playerid, 512, DIALOG_STYLE_INPUT, "Be Man", "Press Your Info:", "OK", "No");
return 1;
}
case 2:
{
format(string, sizeof(string), "{00FF00}%s Has WoMan", GetName(playerid));
SendClientMessageToAll(-1, string);
SetTimerEx("ManMessage", 10000, 0, "d", playerid);
return 1;
}
}

if(dialogid == 512 && response)
{
if(!strlen(inputtext)) return SendClientMessage(playerid, -1, "Your Name Please!");
SetPlayerName(playerid, inputtext);
format(string, sizeof(string), "Your New Name:", inputtext);
SendClientMessage(playerid, -1, string);
return 1;
}
}

return 1;
}
Fixed code
Reply
#3

Quote:
Originally Posted by Kinglee
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[256];
if(dialogid == 50 && response)
{
switch(listitem)
{
case 0:
{
if(HasMan[playerid] == 0)
{
HasMan[playerid] = 1;
SendClientMessage(playerid, -1, ".{00FF00}Work!");
}else{
HasMan[playerid] = 0;
SendClientMessage(playerid, -1, ".{FF0000}No Work!");
}
return 1;
}
case 1:
{
ShowPlayerDialog(playerid, 512, DIALOG_STYLE_INPUT, "Be Man", "Press Your Info:", "OK", "No");
return 1;
}
case 2:
{
format(string, sizeof(string), "{00FF00}%s Has WoMan", GetName(playerid));
SendClientMessageToAll(-1, string);
SetTimerEx("ManMessage", 10000, 0, "d", playerid);
return 1;
}
}

if(dialogid == 512 && response)
{
if(!strlen(inputtext)) return SendClientMessage(playerid, -1, "Your Name Please!");
SetPlayerName(playerid, inputtext);
format(string, sizeof(string), "Your New Name:", inputtext);
SendClientMessage(playerid, -1, string);
return 1;
}
}

return 1;
}
Fixed code
Does not work!
What i do ?!
Reply
#4

Up!
Is Import!
Reply
#5

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[256];
if(dialogid == 50 && response)
{
switch(listitem)
{
case 0:
{
if(HasMan[playerid] == 0)
{
HasMan[playerid] = 1;
SendClientMessage(playerid, -1, ".{00FF00}Work!");
}else{
HasMan[playerid] = 0;
SendClientMessage(playerid, -1, ".{FF0000}No Work!");
}
return 0;
}
case 1:
{
ShowPlayerDialog(playerid, 512, DIALOG_STYLE_INPUT, "Be Man", "Press Your Info:", "OK", "No");
return 0;
}
case 2:
{
format(string, sizeof(string), "{00FF00}%s Has WoMan", GetName(playerid));
SendClientMessageToAll(-1, string);
SetTimerEx("ManMessage", 10000, 0, "d", playerid);
return 0;
}
}

if(dialogid == 512 && response)
{
if(!strlen(inputtext)) return SendClientMessage(playerid, -1, "Your Name Please!");
SetPlayerName(playerid, inputtext);
format(string, sizeof(string), "Your New Name:", inputtext);
SendClientMessage(playerid, -1, string);
return 0;
}
}

return 0;
}
Try this hope it works
Reply
#6

Quote:
Originally Posted by Kinglee
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[256];
if(dialogid == 50 && response)
{
switch(listitem)
{
case 0:
{
if(HasMan[playerid] == 0)
{
HasMan[playerid] = 1;
SendClientMessage(playerid, -1, ".{00FF00}Work!");
}else{
HasMan[playerid] = 0;
SendClientMessage(playerid, -1, ".{FF0000}No Work!");
}
return 0;
}
case 1:
{
ShowPlayerDialog(playerid, 512, DIALOG_STYLE_INPUT, "Be Man", "Press Your Info:", "OK", "No");
return 0;
}
case 2:
{
format(string, sizeof(string), "{00FF00}%s Has WoMan", GetName(playerid));
SendClientMessageToAll(-1, string);
SetTimerEx("ManMessage", 10000, 0, "d", playerid);
return 0;
}
}

if(dialogid == 512 && response)
{
if(!strlen(inputtext)) return SendClientMessage(playerid, -1, "Your Name Please!");
SetPlayerName(playerid, inputtext);
format(string, sizeof(string), "Your New Name:", inputtext);
SendClientMessage(playerid, -1, string);
return 0;
}
}

return 0;
}
Try this hope it works
No work, what is the fucking problem ?!
Reply
#7

Up!!!
Reply
#8

First use some TABs to make your code looks good. Secondly did you call the dialogues via ShowPlayerDialog ??!!
Reply
#9

Quote:
Originally Posted by FilesMAker
Посмотреть сообщение
First use some TABs to make your code looks good. Secondly did you call the dialogueq via ShowPlayerDialog ??!!
This help? So I have not seen here for help. I have revised the code!
Reply
#10

Up..!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)