SA-MP Forums Archive
I Need Help With Dialog! Is Imported! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I Need Help With Dialog! Is Imported! (/showthread.php?tid=536724)



I Need Help With Dialog! Is Imported! - ilay65 - 11.09.2014

Код:
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!


Re: I Need Help With Dialog! Is Imported! - Dangjai - 11.09.2014

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


Re: I Need Help With Dialog! Is Imported! - ilay65 - 11.09.2014

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 ?!


Re: I Need Help With Dialog! Is Imported! - ilay65 - 11.09.2014

Up!
Is Import!


Re: I Need Help With Dialog! Is Imported! - Dangjai - 11.09.2014

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


Re: I Need Help With Dialog! Is Imported! - ilay65 - 11.09.2014

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 ?!


Re: I Need Help With Dialog! Is Imported! - ilay65 - 12.09.2014

Up!!!


Re : I Need Help With Dialog! Is Imported! - FilesMAker - 12.09.2014

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


Re: Re : I Need Help With Dialog! Is Imported! - ilay65 - 12.09.2014

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!


Re: I Need Help With Dialog! Is Imported! - ilay65 - 12.09.2014

Up..!