public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new colormsg[128], color; if(dialogid == 1) { if(response) { switch(listitem) { case 1: {color = 0xF30DFF00;} case 2: {color = 0xB10AFF00;} case 3: {color = 0x7B7DED00;} case 4: {color = 0x0FFAA00;} case 5: {color = 0xFF7A2100;} case 6: {color = 0x75757500;} case 7: {color = 0xFF858500;} } SetPlayerColor(playerid, color); return 1; } } } return 0; }
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/ccolor", true) == 0) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}Chat Colors", " {F30DFF}Pink\n{B10AFF}Purple\n{7B7DED}Navy Blue\n{00FFAA}Turqoise\n{FF7A21}Vibrant Orange\n{757575}Dark Grey\n{FF8585}Light Red\n{F6FF00}Bright Yellow\n{A34D4D}Brown", "Choose", "Cancel"); return 1; } return 0; }
GM.pwn(179) : warning 204: symbol is assigned a value that is never used: "colormsg" GM.pwn(179 -- 199) : warning 209: function "OnDialogResponse" should return a value GM.pwn(179 -- 200) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. ================ READY ================
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new colormsg[128], color; if(dialogid == 1) { if(response) { switch(listitem) { case 1: {color = 0xF30DFF00;} case 2: {color = 0xB10AFF00;} case 3: {color = 0x7B7DED00;} case 4: {color = 0x0FFAA00;} case 5: {color = 0xFF7A2100;} case 6: {color = 0x75757500;} case 7: {color = 0xFF858500;} } SetPlayerColor(playerid, color); return 1; } }// this Was the problem Remove it because your opening 4 and closing 5. } return 0; }
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/ccolor", true) == 0) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}Chat Colors", " {F30DFF}Pink\n{B10AFF}Purple\n{7B7DED}Navy Blue\n{00FFAA}Turqoise\n{FF7A21}Vibrant Orange\n{757575}Dark Grey\n{FF8585}Light Red\n{F6FF00}Bright Yellow\n{A34D4D}Brown", "Choose", "Cancel"); return 1; } return 0; }
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/ccolor", true) == 0) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}Chat Colors", " {F30DFF}Pink\n{B10AFF}Purple\n{7B7DED}Navy Blue\n{00FFAA}Turqoise\n{FF7A21}Vibrant Orange\n{757575}Dark Grey\n{FF8585}Light Red\n{F6FF00}Bright Yellow\n{A34D4D}Brown", "Choose", "Cancel"); return 1; } return 0; } |
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/ccolor", true) == 0) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}Chat Colors", " {F30DFF}Pink\n{B10AFF}Purple\n{7B7DED}Navy Blue\n{00FFAA}Turqoise\n{FF7A21}Vibrant Orange\n{757575}Dark Grey\n{FF8585}Light Red\n{F6FF00}Bright Yellow\n{A34D4D}Brown", "Choose", "Cancel"); return 1; } return 1; }
#define DIALOG_ID_VIP_COLORS 1
CMD:ccolor(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_ID_VIP_COLORS, DIALOG_STYLE_LIST, "{FFFFFF}Chat Colors", "{F30DFF}Pink\n{B10AFF}Purple\n{7B7DED}Navy Blue\n{00FFAA}Turqoise\n{FF7A21}Vibrant Orange\n{757575}Dark Grey\n{FF8585}Light Red\n{F6FF00}Bright Yellow\n{A34D4D}Brown", "Choose", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_ID_VIP_COLORS:
{
if(response)
{
new _:color;
switch(listitem)
{
// Listitem ID starts from 0. There are 9 items.
case 0: color = 0xF30DFF00;
case 1: color = 0xB10AFF00;
case 2: color = 0x7B7DED00;
case 3: color = 0x00FFAA00;
case 4: color = 0xFF7A2100;
case 5: color = 0x75757500;
case 6: color = 0xFF858500;
case 7: color = 0xF6FF0000;
case 8: color = 0xA34D4D00;
}
SendClientMessage(playerid, _:color, "* This is your new color.");
SetPlayerColor(playerid, _:color);
}
}
}
return 1;
}