Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new PlayerText:gCol[MAX_PLAYERS][26];
- new PlayerColors[204] =
- {
- 0xFF8C13AA,0xC715FFAA,0x20B2AAAA,0xDC143CAA,0x6495EDAA,0xf0e68cAA,0x778899AA,0xFF1493AA,0xF4A460AA,
- 0xEE82EEAA,0xFFD720AA,0x8b4513AA,0x4949A0AA,0x148b8bAA,0x14ff7fAA,0x556b2fAA,0x0FD9FAAA,0x10DC29AA,
- 0x534081AA,0x0495CDAA,0xEF6CE8AA,0xBD34DAAA,0x247C1BAA,0x0C8E5DAA,0x635B03AA,0xCB7ED3AA,0x65ADEBAA,
- 0x5C1ACCAA,0xF2F853AA,0x11F891AA,0x7B39AAAA,0x53EB10AA,0x54137DAA,0x275222AA,0xF09F5BAA,0x3D0A4FAA,
- 0x22F767AA,0xD63034AA,0x9A6980AA,0xDFB935AA,0x3793FAAA,0x90239DAA,0xE9AB2FAA,0xAF2FF3AA,0x057F94AA,
- 0xB98519AA,0x388EEAAA,0x028151AA,0xA55043AA,0x0DE018AA,0x93AB1CAA,0x95BAF0AA,0x369976AA,0x18F71FAA,
- 0x4B8987AA,0x491B9EAA,0x829DC7AA,0xBCE635AA,0xCEA6DFAA,0x20D4ADAA,0x2D74FDAA,0x3C1C0DAA,0x12D6D4AA,
- 0x48C000AA,0x2A51E2AA,0xE3AC12AA,0xFC42A8AA,0x2FC827AA,0x1A30BFAA,0xB740C2AA,0x42ACF5AA,0x2FD9DEAA,
- 0xFAFB71AA,0x05D1CDAA,0xC471BDAA,0x94436EAA,0xC1F7ECAA,0xCE79EEAA,0xBD1EF2AA,0x93B7E4AA,0x3214AAAA,
- 0x184D3BAA,0xAE4B99AA,0x7E49D7AA,0x4C436EAA,0xFA24CCAA,0xCE76BEAA,0xA04E0AAA,0x9F945CAA,0xDCDE3DAA,
- 0x10C9C5AA,0x70524DAA,0x0BE472AA,0x8A2CD7AA,0x6152C2AA,0xCF72A9AA,0xE59338AA,0xEEDC2DAA,0xD8C762AA,
- 0xD8C762AA,0xFF8C13AA,0xC715FFAA,0x20B2AAAA,0xDC143CAA,0x6495EDAA,0xf0e68cAA,0x778899AA,0xFF1493AA,
- 0xF4A460AA,0xEE82EEAA,0xFFD720AA,0x8b4513AA,0x4949A0AA,0x148b8bAA,0x14ff7fAA,0x556b2fAA,0x0FD9FAAA,
- 0x10DC29AA,0x534081AA,0x0495CDAA,0xEF6CE8AA,0xBD34DAAA,0x247C1BAA,0x0C8E5DAA,0x635B03AA,0xCB7ED3AA,
- 0x65ADEBAA,0x5C1ACCAA,0xF2F853AA,0x11F891AA,0x7B39AAAA,0x53EB10AA,0x54137DAA,0x275222AA,0xF09F5BAA,
- 0x3D0A4FAA,0x22F767AA,0xD63034AA,0x9A6980AA,0xDFB935AA,0x3793FAAA,0x90239DAA,0xE9AB2FAA,0xAF2FF3AA,
- 0x057F94AA,0xB98519AA,0x388EEAAA,0x028151AA,0xA55043AA,0x0DE018AA,0x93AB1CAA,0x95BAF0AA,0x369976AA,
- 0x18F71FAA,0x4B8987AA,0x491B9EAA,0x829DC7AA,0xBCE635AA,0xCEA6DFAA,0x20D4ADAA,0x2D74FDAA,0x3C1C0DAA,
- 0x12D6D4AA,0x48C000AA,0x2A51E2AA,0xE3AC12AA,0xFC42A8AA,0x2FC827AA,0x1A30BFAA,0xB740C2AA,0x42ACF5AA,
- 0x2FD9DEAA,0xFAFB71AA,0x05D1CDAA,0xC471BDAA,0x94436EAA,0xC1F7ECAA,0xCE79EEAA,0xBD1EF2AA,0x93B7E4AA,
- 0x3214AAAA,0x184D3BAA,0xAE4B99AA,0x7E49D7AA,0x4C436EAA,0xFA24CCAA,0xCE76BEAA,0xA04E0AAA,0x9F945CAA,
- 0xDCDE3DAA,0x10C9C5AA,0x70524DAA,0x0BE472AA,0x8A2CD7AA,0x6152C2AA,0xCF72A9AA,0xE59338AA,0xEEDC2DAA,
- 0xD8C762AA,0xD8C762AA,0xA2FF00AA,0xFFA600AA,0xFF00AEAA,0xBF00FFAA
- };
- /*==============================Callbacks=====================================*/
- public OnFilterScriptInit()
- {
- print("--------------------------------------");
- print(" Loaded Player Color Picker || rColor v0.1 || by [DoD]Ron");
- print("--------------------------------------");
- for(new x=0; x<MAX_PLAYERS; x++)
- if(IsPlayerConnected(x)) CreateColorTexts(x);
- return 1;
- }
- public OnFilterScriptExit()
- {
- for(new x=0; x<MAX_PLAYERS; x++)
- if(IsPlayerConnected(x))
- if(GetPVarInt(x,"r_Col"))
- {
- CancelSelectTextDraw(x);
- DeletePVar(x,"r_Col");
- for(new y=0; y<26; y++) PlayerTextDrawDestroy(x,gCol[x][y]);
- }
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/rcolor", true))
- {
- SetPVarInt(playerid,"r_Col",1);
- ShowColors(playerid);
- return 1;
- }
- return 0;
- }
- public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
- {
- if(_:playertextid != INVALID_TEXT_DRAW)
- {
- new f;
- if(playertextid == gCol[playerid][20]) SetPVarInt(playerid,"r_Col",5),ShowColors(playerid);
- else if(playertextid == gCol[playerid][22]) SetPVarInt(playerid,"r_Col",4),ShowColors(playerid);
- else if(playertextid == gCol[playerid][25]) SetPVarInt(playerid,"r_Col",3),ShowColors(playerid);
- else if(playertextid == gCol[playerid][24]) SetPVarInt(playerid,"r_Col",2),ShowColors(playerid);
- else if(playertextid == gCol[playerid][21]) SetPVarInt(playerid,"r_Col",1),ShowColors(playerid);
- else
- {
- for(new x=3; x<20; x++)
- {
- if(playertextid == gCol[playerid][x])
- {
- new rCol = 20*(GetPVarInt(playerid,"r_Col")-1)+f;
- SetPlayerColor(playerid,PlayerColors[rCol]);
- for(new y=0; y<26; y++) PlayerTextDrawHide(playerid,gCol[playerid][y]);
- new str[128];
- format(str,sizeof(str)," -rColors- {94DBE3}You color has been changed to {%06x}||||||||||||||",(GetPlayerColor(playerid) >>> 8));
- SendClientMessage(playerid,0x03E6FF3FF,str);
- CancelSelectTextDraw(playerid);
- DeletePVar(playerid,"r_Col");
- break;
- }
- else f++;
- }
- }
- }
- return 1;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(_:clickedid == INVALID_TEXT_DRAW)
- {
- if(GetPVarInt(playerid,"r_Col"))
- {
- for(new x=0; x<26; x++)
- {
- PlayerTextDrawHide(playerid,gCol[playerid][x]);
- }
- DeletePVar(playerid,"r_Col");
- }
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- CreateColorTexts(playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid,reason)
- {
- for(new y=0; y<26; y++) PlayerTextDrawDestroy(playerid,gCol[playerid][y]);
- return 1;
- }
- /*==============================Stocks=====================================*/
- stock CreateColorTexts(playerid)
- {
- gCol[playerid][0] = CreatePlayerTextDraw(playerid,166.000000, 13.000000, "-");
- PlayerTextDrawBackgroundColor(playerid,gCol[playerid][0], 255);
- PlayerTextDrawFont(playerid,gCol[playerid][0], 1);
- PlayerTextDrawLetterSize(playerid,gCol[playerid][0], 19.399997, 30.299995);
- PlayerTextDrawColor(playerid,gCol[playerid][0], -1);
- PlayerTextDrawSetOutline(playerid,gCol[playerid][0], 0);
- PlayerTextDrawSetProportional(playerid,gCol[playerid][0], 1);
- PlayerTextDrawSetShadow(playerid,gCol[playerid][0], 1);
- gCol[playerid][1] = CreatePlayerTextDraw(playerid,252.000000, 164.000000, "~r~~h~C~h~o~h~l~h~o~r~r ~b~l~g~i~y~s~p~t");
- PlayerTextDrawBackgroundColor(playerid,gCol[playerid][1], 255);
- PlayerTextDrawFont(playerid,gCol[playerid][1], 3);
- PlayerTextDrawLetterSize(playerid,gCol[playerid][1], 0.490000, 2.199999);
- PlayerTextDrawColor(playerid,gCol[playerid][1], -1);
- PlayerTextDrawSetOutline(playerid,gCol[playerid][1], 1);
- PlayerTextDrawSetProportional(playerid,gCol[playerid][1], 1);
- gCol[playerid][2] = CreatePlayerTextDraw(playerid,305.000000, 186.000000, "_");
- PlayerTextDrawAlignment(playerid,gCol[playerid][2], 2);
- PlayerTextDrawBackgroundColor(playerid,gCol[playerid][2], 255);
- PlayerTextDrawFont(playerid,gCol[playerid][2], 1);
- PlayerTextDrawLetterSize(playerid,gCol[playerid][2], 1.029999, 10.699993);
- PlayerTextDrawColor(playerid,gCol[playerid][2], -1);
- PlayerTextDrawSetOutline(playerid,gCol[playerid][2], 0);
- PlayerTextDrawSetProportional(playerid,gCol[playerid][2], 1);
- PlayerTextDrawSetShadow(playerid,gCol[playerid][2], 1);
- PlayerTextDrawUseBox(playerid,gCol[playerid][2], 1);
- PlayerTextDrawBoxColor(playerid,gCol[playerid][2], 255);
- PlayerTextDrawTextSize(playerid,gCol[playerid][2], 130.000000, 323.000000);
- new Float:var=189.0;
- for(new l=3; l<20; l++)
- {
- gCol[playerid][l] = CreatePlayerTextDraw(playerid,305.000000, var, "_");
- PlayerTextDrawAlignment(playerid,gCol[playerid][l], 2);
- PlayerTextDrawBackgroundColor(playerid,gCol[playerid][l], 255);
- PlayerTextDrawFont(playerid,gCol[playerid][l], 1);
- PlayerTextDrawLetterSize(playerid,gCol[playerid][l], 1.019999, 0.040001);
- PlayerTextDrawColor(playerid,gCol[playerid][l], -1);
- PlayerTextDrawSetOutline(playerid,gCol[playerid][l], 0);
- PlayerTextDrawSetProportional(playerid,gCol[playerid][l], 1);
- PlayerTextDrawSetShadow(playerid,gCol[playerid][l], 1);
- PlayerTextDrawUseBox(playerid,gCol[playerid][l], 1);
- PlayerTextDrawBoxColor(playerid,gCol[playerid][l], 255);
- PlayerTextDrawTextSize(playerid,gCol[playerid][l], 103.000000, 309.000000);
- PlayerTextDrawSetSelectable(playerid,gCol[playerid][l],1);
- var+=5.0;
- }
- gCol[playerid][20] = CreatePlayerTextDraw(playerid,196.000000, 275.000000, "5");
- PlayerTextDrawBackgroundColor(playerid,gCol[playerid][20], 255);
- PlayerTextDrawFont(playerid,gCol[playerid][20], 1);
- PlayerTextDrawLetterSize(playerid,gCol[playerid][20], 0.310000, 0.699999);
- PlayerTextDrawColor(playerid,gCol[playerid][20], -1);
- PlayerTextDrawSetOutline(playerid,gCol[playerid][20], 0);
- PlayerTextDrawSetProportional(playerid,gCol[playerid][20], 1);
- PlayerTextDrawSetShadow(playerid,gCol[playerid][20], 1);
- PlayerTextDrawUseBox(playerid,gCol[playerid][20], 1);
- PlayerTextDrawTextSize(playerid,gCol[playerid][20], 156.000000, 4.000000);
- PlayerTextDrawUseBox(playerid,gCol[playerid][20], 1);
- PlayerTextDrawBoxColor(playerid,gCol[playerid][20], 0);
- PlayerTextDrawTextSize(playerid,gCol[playerid][20], 203.000000, 20.000000);
- PlayerTextDrawSetSelectable(playerid,gCol[playerid][20],1);
- gCol[playerid][21] = CreatePlayerTextDraw(playerid,150.000000, 275.000000, "1");
- PlayerTextDrawBackgroundColor(playerid,gCol[playerid][21], 255);
- PlayerTextDrawFont(playerid,gCol[playerid][21], 1);
- PlayerTextDrawLetterSize(playerid,gCol[playerid][21], 0.310000, 0.699999);
- PlayerTextDrawColor(playerid,gCol[playerid][21], -1);
- PlayerTextDrawSetOutline(playerid,gCol[playerid][21], 0);
- PlayerTextDrawSetProportional(playerid,gCol[playerid][21], 1);
- PlayerTextDrawSetShadow(playerid,gCol[playerid][21], 1);
- PlayerTextDrawUseBox(playerid,gCol[playerid][21], 1);
- PlayerTextDrawBoxColor(playerid,gCol[playerid][21], 0);
- PlayerTextDrawTextSize(playerid,gCol[playerid][21], 156.000000, 20.000000);
- PlayerTextDrawSetSelectable(playerid,gCol[playerid][21],1);
- gCol[playerid][24] = CreatePlayerTextDraw(playerid,161.000000, 275.000000, "2");
- PlayerTextDrawBackgroundColor(playerid,gCol[playerid][24], 255);
- PlayerTextDrawFont(playerid,gCol[playerid][24], 1);
- PlayerTextDrawLetterSize(playerid,gCol[playerid][24], 0.310000, 0.699999);
- PlayerTextDrawColor(playerid,gCol[playerid][24], -1);
- PlayerTextDrawSetOutline(playerid,gCol[playerid][24], 0);
- PlayerTextDrawSetProportional(playerid,gCol[playerid][24], 1);
- PlayerTextDrawSetShadow(playerid,gCol[playerid][24], 1);
- PlayerTextDrawUseBox(playerid,gCol[playerid][24], 1);
- PlayerTextDrawBoxColor(playerid,gCol[playerid][24], 0);
- PlayerTextDrawTextSize(playerid,gCol[playerid][24], 168.000000, 20.000000);
- PlayerTextDrawSetSelectable(playerid,gCol[playerid][24],1);
- gCol[playerid][25] = CreatePlayerTextDraw(playerid,173.000000, 275.000000, "3");
- PlayerTextDrawBackgroundColor(playerid,gCol[playerid][25], 255);
- PlayerTextDrawFont(playerid,gCol[playerid][25], 1);
- PlayerTextDrawLetterSize(playerid,gCol[playerid][25], 0.310000, 0.699999);
- PlayerTextDrawColor(playerid,gCol[playerid][25], -1);
- PlayerTextDrawSetOutline(playerid,gCol[playerid][25], 0);
- PlayerTextDrawSetProportional(playerid,gCol[playerid][25], 1);
- PlayerTextDrawSetShadow(playerid,gCol[playerid][25], 1);
- PlayerTextDrawUseBox(playerid,gCol[playerid][25], 1);
- PlayerTextDrawBoxColor(playerid,gCol[playerid][25], 0);
- PlayerTextDrawTextSize(playerid,gCol[playerid][25], 180.000000, 20.000000);
- PlayerTextDrawSetSelectable(playerid,gCol[playerid][25],1);
- gCol[playerid][22] = CreatePlayerTextDraw(playerid,184.000000, 275.000000, "4");
- PlayerTextDrawBackgroundColor(playerid,gCol[playerid][22], 255);
- PlayerTextDrawFont(playerid,gCol[playerid][22], 1);
- PlayerTextDrawLetterSize(playerid,gCol[playerid][22], 0.310000, 0.699999);
- PlayerTextDrawColor(playerid,gCol[playerid][22], -1);
- PlayerTextDrawSetOutline(playerid,gCol[playerid][22], 0);
- PlayerTextDrawSetProportional(playerid,gCol[playerid][22], 1);
- PlayerTextDrawSetShadow(playerid,gCol[playerid][22], 1);
- PlayerTextDrawUseBox(playerid,gCol[playerid][22], 1);
- PlayerTextDrawBoxColor(playerid,gCol[playerid][22], 0);
- PlayerTextDrawTextSize(playerid,gCol[playerid][22], 191.000000, 20.000000);
- PlayerTextDrawSetSelectable(playerid,gCol[playerid][22],1);
- }
- stock ShowColors(playerid)
- {
- new f=(GetPVarInt(playerid,"r_Col")-1)*20;
- for(new x=0; x<26; x++)
- {
- if(x > 2 && x<20)
- {
- PlayerTextDrawBoxColor(playerid, gCol[playerid][x],PlayerColors[f]);
- f++;
- }
- PlayerTextDrawShow(playerid,gCol[playerid][x]);
- }
- SelectTextDraw(playerid,0xE01B1BCC);
- }
Advertisement
Add Comment
Please, Sign In to add comment