19.06.2016, 17:07
I am trying to make a command, /ccolor for VIPs, where they can change their chat color.
I have done this so far:
combined with:
It does not compile and I do not what is wrong.
Here are the errors:
Also, would the switch(listitem) on each case work with a formatted message, along with the { color = .... ; } ? I have tried it and I got the error saying "Only one message can be assigned on each case".
I have done this so far:
Код:
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;
}
Here are the errors:
Код:
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 ================


