22.05.2014, 04:05
Under your PlayerInfo enum insert pColor
Then follow this code.
Then,Under OnPlayerDisconnect
Then follow this code.
Код:
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); PlayerInfo[playerid][pColor]=GetPlayerColor(playerid); case 1: SetPlayerColor(playerid, COLOR_PINK); PlayerInfo[playerid][pColor]=GetPlayerColor(playerid); case 2: SetPlayerColor(playerid, COLOR_LIGHTBLUE); PlayerInfo[playerid][pColor]=GetPlayerColor(playerid); case 3: SetPlayerColor(playerid, COLOR_LIGHTGREEN); PlayerInfo[playerid][pColor]=GetPlayerColor(playerid); case 4: SetPlayerColor(playerid, COLOR_GREY); PlayerInfo[playerid][pColor]=GetPlayerColor(playerid); case 5: SetPlayerColor(playerid, COLOR_WHITE); PlayerInfo[playerid][pColor]=GetPlayerColor(playerid); case 6: SetPlayerColor(playerid, COLOR_ORANGE); PlayerInfo[playerid][pColor]=GetPlayerColor(playerid); case 7: SetPlayerColor(playerid, COLOR_YELLOW); PlayerInfo[playerid][pColor]=GetPlayerColor(playerid); case 8: SetPlayerColor(playerid, COLOR_RED); PlayerInfo[playerid][pColor]=GetPlayerColor(playerid); case 9: SetPlayerColor(playerid, COLOR_GREEN); PlayerInfo[playerid][pColor]=GetPlayerColor(playerid); } } }
Код:
public OnPlayerDisconnect(playerid, reason) { new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteString(File,"Color",PlayerInfo[playerid][pColor]); INI_Close(File); return 1; }