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; }
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;
}
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;
}
pawn Код:
|
First use some TABs to make your code looks good. Secondly did you call the dialogueq via ShowPlayerDialog ??!!
|