Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- This script is included in my very first "Jake EvoLuTioN 2013 scripts" album
- The album might release soon containing my very very popular from my previous script
- JakAdmin v2.8. This script is under Jake Production script.
- Jake's Efficient Color Changer
- ----------
- Ability to change color without using a command with just a key!
- Author: Jake, Zeex
- - Part of Jake EvoLuTioN 2013 script - (c) 2013 August
- Changelogs v1.0:
- • Default colors 8!
- • Can browse colors without dialog or commands, Just uses with Key!
- • 2 commands to do the browsing:
- /browsecolor - Browses color and the key takes the action in selecting, and choosing!
- /stopbrowsec - Stops browsing the color. Returns back to normal color
- • Additional 1 command:
- /helpbrowsec
- */
- #include <a_samp>
- #include <zcmd>
- new
- bool:ChoosingColor[MAX_PLAYERS] = false,
- CurrentCol[MAX_PLAYERS] = -1
- ;
- public OnFilterScriptInit()
- {
- print("\n");
- print("*** Jake Script Production Exclusive ***");
- print("ECHO: Presents");
- SetTimer("SendPrint", 1200, 0);
- return 1;
- }
- forward SendPrint();
- public SendPrint()
- {
- print("Jake's Efficient Color Changer");
- print("Ability to change color without using a command with just a key!");
- print("Copyrights - 2013 (August)");
- print("Author: Jake, Zeex for zcmd");
- print("Idea from C Fast Color Changer");
- print("\n");
- }
- public OnPlayerConnect(playerid)
- {
- if(ChoosingColor[playerid] == true)
- {
- ChoosingColor[playerid] = false;
- CurrentCol[playerid] = -1;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(ChoosingColor[playerid] == true)
- {
- ChoosingColor[playerid] = false;
- CurrentCol[playerid] = -1;
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(ChoosingColor[playerid] == true)
- {
- if(newkeys == KEY_YES)
- {
- CurrentCol[playerid]++;
- if(CurrentCol[playerid] == 0)
- {
- SetPlayerColor(playerid, 0xFFFF00AA);
- GameTextForPlayer(playerid, "~w~Color: ~y~Yellow~n~~w~Color ID: 1", 2000, 3);
- }
- else if(CurrentCol[playerid] == 1)
- {
- SetPlayerColor(playerid, 0x33CC33C8);
- GameTextForPlayer(playerid, "~w~Color: ~g~Green~n~~w~Color ID: 2", 2000, 3);
- }
- else if(CurrentCol[playerid] == 2)
- {
- SetPlayerColor(playerid, 0xFF8000C8);
- GameTextForPlayer(playerid, "~w~Color: Orange~n~~w~Color ID: 3", 2000, 3);
- }
- else if(CurrentCol[playerid] == 3)
- {
- SetPlayerColor(playerid, 0xFFFFFFFF);
- GameTextForPlayer(playerid, "~w~Color: White~n~Color ID: 4", 2000, 3);
- }
- else if(CurrentCol[playerid] == 4)
- {
- SetPlayerColor(playerid, 0x0080FFC8);
- GameTextForPlayer(playerid, "~w~Color: ~b~Blue~n~~w~Color ID: 5", 2000, 3);
- }
- else if(CurrentCol[playerid] == 5)
- {
- SetPlayerColor(playerid, 0xFF80FFFF);
- GameTextForPlayer(playerid, "~w~Color: ~r~~h~~h~~h~~h~Pink~n~~w~Color ID: 6", 2000, 3);
- }
- else if(CurrentCol[playerid] == 6)
- {
- SetPlayerColor(playerid, 0xA52A2AAA);
- GameTextForPlayer(playerid, "~w~Color: Brown~n~~w~Color ID: 7", 2000, 3);
- }
- else if(CurrentCol[playerid] == 7)
- {
- SetPlayerColor(playerid, 0x2C2727AA);
- GameTextForPlayer(playerid, "~w~Color: ~l~Black~n~~w~Color ID: 8", 2000, 3);
- }
- else if(CurrentCol[playerid] == 8)
- {
- SetPlayerColor(playerid, 0xFF0000C8);
- GameTextForPlayer(playerid, "~w~Color: ~r~Red~n~~w~Color ID: 9", 2000, 3);
- }
- else if(CurrentCol[playerid] >= 9)
- {
- GameTextForPlayer(playerid, "~r~No more colors available!~n~~w~Only ~y~8 ~w~colors!~n~~w~To move back press ~r~N", 4000, 3);
- }
- }
- else if(newkeys == KEY_NO)
- {
- CurrentCol[playerid]--;
- if(CurrentCol[playerid] == 0)
- {
- SetPlayerColor(playerid, 0xFFFF00AA);
- GameTextForPlayer(playerid, "~w~Color: ~y~Yellow~n~~w~Color ID: 1", 2000, 3);
- }
- else if(CurrentCol[playerid] == 1)
- {
- SetPlayerColor(playerid, 0x33CC33C8);
- GameTextForPlayer(playerid, "~w~Color: ~g~Green~n~~w~Color ID: 2", 2000, 3);
- }
- else if(CurrentCol[playerid] == 2)
- {
- SetPlayerColor(playerid, 0xFF8000C8);
- GameTextForPlayer(playerid, "~w~Color: Orange~n~Color ID: 3", 2000, 3);
- }
- else if(CurrentCol[playerid] == 3)
- {
- SetPlayerColor(playerid, 0xFFFFFFFF);
- GameTextForPlayer(playerid, "~w~Color: White~n~~w~Color ID: 4", 2000, 3);
- }
- else if(CurrentCol[playerid] == 4)
- {
- SetPlayerColor(playerid, 0x0080FFC8);
- GameTextForPlayer(playerid, "~w~Color: ~b~Blue~n~~w~Color ID: 5", 2000, 3);
- }
- else if(CurrentCol[playerid] == 5)
- {
- SetPlayerColor(playerid, 0xFF80FFFF);
- GameTextForPlayer(playerid, "~w~Color: ~r~~h~~h~~h~~h~~h~Pink~n~~w~Color ID: 6", 2000, 3);
- }
- else if(CurrentCol[playerid] == 6)
- {
- SetPlayerColor(playerid, 0xA52A2AAA);
- GameTextForPlayer(playerid, "~w~Color: Brown~n~Color ID: 7", 2000, 3);
- }
- else if(CurrentCol[playerid] == 7)
- {
- SetPlayerColor(playerid, 0x2C2727AA);
- GameTextForPlayer(playerid, "~w~Color: ~l~Black~n~~w~Color ID: 8", 2000, 3);
- }
- else if(CurrentCol[playerid] >= -1)
- {
- GameTextForPlayer(playerid, "~r~No more colors available!~n~~w~Only ~y~8 ~w~colors!~n~~w~To move back press ~r~Y", 4000, 3);
- }
- }
- if(newkeys == KEY_FIRE)
- {
- if(CurrentCol[playerid] != -1 || CurrentCol[playerid] >= 9)
- {
- DeletePVar(playerid, "JECCColor");
- GameTextForPlayer(playerid, "~w~Color ~g~Successfully ~y~choosed!", 2000, 3);
- ChoosingColor[playerid] = false;
- CurrentCol[playerid] = -1;
- TogglePlayerControllable(playerid, 1);
- }
- }
- }
- return 1;
- }
- CMD:browsecolor(playerid, params[])
- {
- if(ChoosingColor[playerid] == true) return SendClientMessage(playerid, 0xFF0000C8, "You're already browsing, selecting colors, /stopbrowsec to stop browsing!");
- TogglePlayerControllable(playerid, 0);
- GameTextForPlayer(playerid, "~w~Browsing Color Controls:~n~~y~Y for forward browsing~n~~r~N for backward browsing!~n~~g~Press FIRE key to select the color!", 4300, 3);
- ChoosingColor[playerid] = true;
- SetPVarInt(playerid, "JECCColor", GetPlayerColor(playerid));
- SendClientMessage(playerid, -1, "=== Jake's Efficient Color Changer Controls ===");
- SendClientMessage(playerid, 0x33CC33C8, "Press Y for forward color browsing!");
- SendClientMessage(playerid, 0xFF0000C8, "Press N for backward color browsing!");
- SendClientMessage(playerid, -1, "Press FIRE key to choose the selected color!");
- return 1;
- }
- CMD:stopbrowsec(playerid, params[])
- {
- if(ChoosingColor[playerid] == false) return SendClientMessage(playerid, 0xFF0000C8, "You're not browsing, selecting colors! To start browsing, /browsecolor!");
- TogglePlayerControllable(playerid, 1);
- GameTextForPlayer(playerid, "~r~Browsing colors has been stopped!~n~~w~Color back to ~g~normal!", 3000, 3);
- ChoosingColor[playerid] = false;
- SetPlayerColor(playerid, GetPVarInt(playerid, "JECCColor"));
- DeletePVar(playerid, "JECCColor");
- SendClientMessage(playerid, 0xFF0000C8, "Browsing colors has been stopped, Color back to normal!");
- return 1;
- }
- CMD:helpbrowsec(playerid, params[])
- {
- SendClientMessage(playerid, -1, "=== Jake's Efficient Color Changer Help ===");
- SendClientMessage(playerid, -1, "Commands: /helpbrowsec, /browsecolor, /stopbrowsec");
- SendClientMessage(playerid, -1, "Instruction Manual:");
- SendClientMessage(playerid, -1, "1. Type /browsecolor in the chat menu");
- SendClientMessage(playerid, -1, "2. Choose color by browsing, with Y and N keys!");
- SendClientMessage(playerid, -1, "3. Click the FIRE key if you've selected your color!");
- SendClientMessage(playerid, -1, "4. Done!");
- SendClientMessage(playerid, -1, "If you don't want to browse color anymore, Just /stopbrowsec!");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment