22.05.2014, 02:41
hello everyone,
i need help with Player colour, i want if them change /color (my commands) its will be save
when they connect to my server again, this my code
OndialogResponse
i need help with Player colour, i want if them change /color (my commands) its will be save
when they connect to my server again, this my code
Код:
CMD:color(playerid, params[])
{
if(pInfo[playerid][Invisible] == 1) return SendClientMessage(playerid, COLOR_RED, "[Error]: You are invsible, You cannot use this command!");
if(GetPlayerState(playerid) != 1 && GetPlayerState(playerid) != 2 && GetPlayerState(playerid) != 3)
return SendClientMessage(playerid, COLOR_RED, "[Spawned]: You're not able to use this command!, Spawn first!");
ShowPlayerDialog(playerid, DIALOG_COLOR, DIALOG_STYLE_LIST, ""white"Change Color", "Purple\nPink\nLight Blue\nLight Green\nGrey\nWhite\nOrange\nYellow\nRed\nGreen", "Change", "Cancel");
SendAdminCMD(playerid, "color");
return 1;
}
Код:
if(dialogid == DIALOG_COLOR)
{
if(!response) return 1;
else if(response)
{
SendClientMessage(playerid, COLOR_LIME, "{FF0000}xSF {A0A0A0}» {FFFFFF}Your name color has been successfully changed!");
switch(listitem)
{
case 0: SetPlayerColor(playerid, COLOR_PURPLE);
case 1: SetPlayerColor(playerid, COLOR_PINK);
case 2: SetPlayerColor(playerid, COLOR_LIGHTBLUE);
case 3: SetPlayerColor(playerid, COLOR_LIGHTGREEN);
case 4: SetPlayerColor(playerid, COLOR_GREY);
case 5: SetPlayerColor(playerid, COLOR_WHITE);
case 6: SetPlayerColor(playerid, COLOR_ORANGE);
case 7: SetPlayerColor(playerid, COLOR_YELLOW);
case 8: SetPlayerColor(playerid, COLOR_RED);
case 9: SetPlayerColor(playerid, COLOR_GREEN);
}
}
}

