26.06.2012, 20:17
if player choose color and leave the server, after he/she join back the color he choose before still the same. How??
PHP код:
#include <a_samp>
#define GREEN 0x33AA33AA
#define RED 0xAA3333AA
#define YELLOW 0xFFFF00AA
#define WHITE 0xFFFFFFAA
#define BLUE 0x0000BBAA
#define GOLD 0xB8860BAA
#define PINK 0xFFC0CBAA
#define PURPLE 0x800080FF
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Player Color");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/color", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Player Color", "White\nGreen\nRed\nYellow\nBlue\nPurple\nGold\nPink", "Choose", "Close");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 5)
{
if(response)
{
new string[128];
new message[256+1];
if(listitem == 0)
{
format(string, sizeof(string), "You got now a WHITE name");
SendClientMessage(playerid, 0xFFFFFFAA, message);
SetPlayerColor(playerid, WHITE);
}
if(listitem == 1)
{
format(string, sizeof(string), "You got now a GREEN name");
SendClientMessage(playerid, 0x33AA33AA, message);
SetPlayerColor(playerid, GREEN);
return 1;
}
if(listitem == 2)
{
format(string, sizeof(string), "You got now a RED name");
SendClientMessage(playerid, 0xAA3333AA, message);
SetPlayerColor(playerid, RED);
return 1;
}
if(listitem == 3)
{
format(string, sizeof(string), "You got now a YELLOW name");
SendClientMessage(playerid, 0xFFFF00AA, message);
SetPlayerColor(playerid, YELLOW);
return 1;
}
if(listitem == 4)
{
format(string, sizeof(string), "You got now a BLUE name");
SendClientMessage(playerid, 0x0000BBAA, message);
SetPlayerColor(playerid, BLUE);
return 1;
}
if(listitem == 5)
{
format(string, sizeof(string), "You got now a PURPLE name");
SendClientMessage(playerid, 0x800080FF, message);
SetPlayerColor(playerid, PURPLE);
return 1;
}
if(listitem == 6)
{
format(string, sizeof(string), "You got now a GOLD name");
SendClientMessage(playerid, 0xB8860BAA, message);
SetPlayerColor(playerid, GOLD);
return 1;
}
if(listitem == 7)
{
format(string, sizeof(string), "You got now a PINK name");
SendClientMessage(playerid, 0xFFC0CBAA, message);
SetPlayerColor(playerid, PINK);
return 1;
}
}
}
return 1;
}