Save Player Color
#6

i included with your cmd
Код:
#include <a_samp>
#include <dini>
#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[])
{
    new file[256],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
	format(file, sizeof(file), "%s.ini", name);
    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;
    }
	if (strcmp("/color save", cmdtext, true) == 0)
    {
        if(dini_Int(file,"alreadysaved") != 0) return SendClientMessage(playerid,0xff0000ff,"Sorry , but you already saved your color once!");
        if(!dini_Int(file,"alreadysaved"))
        {
             dini_IntSet(file,"savedcolour",GetPlayerColor(playerid));
             dini_IntSet(file,"alreadysaved",1);
        }
        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;
}
Reply


Messages In This Thread
Save Player Color - by kbalor - 26.06.2012, 20:17
Re: Save Player Color - by iGetty - 26.06.2012, 20:20
Re: Save Player Color - by kbalor - 26.06.2012, 20:26
Re: Save Player Color - by God'Z War - 26.06.2012, 20:35
Re: Save Player Color - by kbalor - 26.06.2012, 20:42
Re: Save Player Color - by God'Z War - 26.06.2012, 20:43
Re: Save Player Color - by kbalor - 27.06.2012, 05:41

Forum Jump:


Users browsing this thread: 1 Guest(s)