Load Player Colour
#3

Under your PlayerInfo enum insert pColor
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);

		    }
		}
	}
Then,Under OnPlayerDisconnect
Код:
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;
}
Reply


Messages In This Thread
Load Player Colour - by TazmaNiax - 22.05.2014, 02:41
Re: Load Player Colour - by TazmaNiax - 22.05.2014, 03:19
Re: Load Player Colour - by Rittik - 22.05.2014, 04:05
Re: Load Player Colour - by TazmaNiax - 22.05.2014, 04:18
Re: Load Player Colour - by TazmaNiax - 22.05.2014, 04:26
Re: Load Player Colour - by JFF - 22.05.2014, 04:34
Re: Load Player Colour - by Rittik - 22.05.2014, 04:38
Re: Load Player Colour - by TazmaNiax - 22.05.2014, 06:15

Forum Jump:


Users browsing this thread: 1 Guest(s)