Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ColorPicker
- Author: Maku, edited by AXV
- Type: include
- Date created: 30-04-2013
- Date updated: 01-05-2013
- Version: 1.0.1
- Copyright 2013 by Maku.
- All rights reserved.
- */
- #if defined _colorpicker_included
- #endinput
- #endif
- #define _colorpicker_included
- #include <a_samp>
- #if !defined _samp_included
- #tryinclude <a_samp>
- #if !defined _samp_included
- #error Brak biblioteki a_samp.inc!!!
- #endif
- #endif
- /*
- Natives:
- native ShowPlayerColorPicker(playerid, pickerid, bool:showalpha = false, bool:showcancel = true);
- native HidePlayerColorPicker(playerid, bool:call_callback = false, call_response = 0);
- native OnColorPickerResponse(playerid, pickerid, color, response);
- */
- #define COLOR_PICKER_RED 0
- #define COLOR_PICKER_GREEN 1
- #define COLOR_PICKER_BLUE 2
- #define COLOR_PICKER_ALPHA 3
- #define COLOR_PICKER_ID 4
- #define COLOR_PICKER_ALPHA_ENABLE 5
- #define RGBAToHex(%0,%1,%2,%3) ((%0)<<24 | (%1)<<16 | (%2)<<8 | (%3))
- new
- Text:cp_Draw[19],
- PlayerText:cp_playerDraw[MAX_PLAYERS][5],
- ChooseColor[MAX_PLAYERS][6]
- ;
- forward OnColorPickerResponse(playerid, pickerid, color, response);
- // Functions
- LoadColorPicker() {
- print ("\n+-----------------------------------------+");
- print ( "| [INC] ColorPicker v1.0.1 by Maku - Loaded |");
- print ( "+-----------------------------------------+\n");
- // window
- cp_Draw[0] = TextDrawCreate(320.000000, 190.000000, "_");
- TextDrawAlignment(cp_Draw[0], 2);
- TextDrawBackgroundColor(cp_Draw[0], 255);
- TextDrawFont(cp_Draw[0], 1);
- TextDrawLetterSize(cp_Draw[0], 0.500000, 10.000000);
- TextDrawColor(cp_Draw[0], -1);
- TextDrawSetOutline(cp_Draw[0], 0);
- TextDrawSetProportional(cp_Draw[0], 1);
- TextDrawSetShadow(cp_Draw[0], 1);
- TextDrawUseBox(cp_Draw[0], 1);
- TextDrawBoxColor(cp_Draw[0], 102);
- TextDrawTextSize(cp_Draw[0], 0.000000, 200.000000);
- // title
- cp_Draw[1] = TextDrawCreate(320.000000, 180.000000, "~y~~h~Color~h~Picker");
- TextDrawAlignment(cp_Draw[1], 2);
- TextDrawBackgroundColor(cp_Draw[1], 32);
- TextDrawFont(cp_Draw[1], 0);
- TextDrawLetterSize(cp_Draw[1], 0.599999, 1.500000);
- TextDrawColor(cp_Draw[1], -1);
- TextDrawSetOutline(cp_Draw[1], 1);
- TextDrawSetProportional(cp_Draw[1], 1);
- // labels
- cp_Draw[2] = TextDrawCreate(269.000000, 223.000000, "Aktualny kolor");
- TextDrawAlignment(cp_Draw[2], 2);
- TextDrawBackgroundColor(cp_Draw[2], 1);
- TextDrawFont(cp_Draw[2], 2);
- TextDrawLetterSize(cp_Draw[2], 0.159999, 0.799998);
- TextDrawColor(cp_Draw[2], -1);
- TextDrawSetOutline(cp_Draw[2], 1);
- TextDrawSetProportional(cp_Draw[2], 1);
- cp_Draw[3] = TextDrawCreate(355.000000, 206.000000, "Koloryzacja");
- TextDrawAlignment(cp_Draw[3], 2);
- TextDrawBackgroundColor(cp_Draw[3], 1);
- TextDrawFont(cp_Draw[3], 2);
- TextDrawLetterSize(cp_Draw[3], 0.159999, 0.799998);
- TextDrawColor(cp_Draw[3], -1);
- TextDrawSetOutline(cp_Draw[3], 1);
- TextDrawSetProportional(cp_Draw[3], 1);
- cp_Draw[4] = TextDrawCreate(319.000000, 211.000000, "~y~~h~-"); // paseczek od napisu 'koloryzacja'
- TextDrawBackgroundColor(cp_Draw[4], 16);
- TextDrawFont(cp_Draw[4], 1);
- TextDrawLetterSize(cp_Draw[4], 5.000000, 0.499998);
- TextDrawColor(cp_Draw[4], -1);
- TextDrawSetOutline(cp_Draw[4], 1);
- TextDrawSetProportional(cp_Draw[4], 1);
- cp_Draw[5] = TextDrawCreate(324.000000, 221.000000, "~r~~h~RED");
- TextDrawAlignment(cp_Draw[5], 2);
- TextDrawBackgroundColor(cp_Draw[5], 1);
- TextDrawFont(cp_Draw[5], 2);
- TextDrawLetterSize(cp_Draw[5], 0.159999, 0.799998);
- TextDrawColor(cp_Draw[5], -1);
- TextDrawSetOutline(cp_Draw[5], 1);
- TextDrawSetProportional(cp_Draw[5], 1);
- cp_Draw[6] = TextDrawCreate(326.000000, 240.000000, "~b~~h~BLUE");
- TextDrawAlignment(cp_Draw[6], 2);
- TextDrawBackgroundColor(cp_Draw[6], 1);
- TextDrawFont(cp_Draw[6], 2);
- TextDrawLetterSize(cp_Draw[6], 0.159999, 0.799998);
- TextDrawColor(cp_Draw[6], -1);
- TextDrawSetOutline(cp_Draw[6], 1);
- TextDrawSetProportional(cp_Draw[6], 1);
- cp_Draw[7] = TextDrawCreate(328.000000, 260.000000, "~g~~h~GREEN");
- TextDrawAlignment(cp_Draw[7], 2);
- TextDrawBackgroundColor(cp_Draw[7], 1);
- TextDrawFont(cp_Draw[7], 2);
- TextDrawLetterSize(cp_Draw[7], 0.159999, 0.799998);
- TextDrawColor(cp_Draw[7], -1);
- TextDrawSetOutline(cp_Draw[7], 1);
- TextDrawSetProportional(cp_Draw[7], 1);
- // clickable
- cp_Draw[8] = TextDrawCreate(355.000000, 220.000000, "<"); // red
- TextDrawAlignment(cp_Draw[8], 2);
- TextDrawBackgroundColor(cp_Draw[8], 0);
- TextDrawFont(cp_Draw[8], 1);
- TextDrawLetterSize(cp_Draw[8], 0.230000, 0.999998);
- TextDrawColor(cp_Draw[8], -1);
- TextDrawSetOutline(cp_Draw[8], 0);
- TextDrawSetProportional(cp_Draw[8], 1);
- TextDrawSetShadow(cp_Draw[8], 1);
- TextDrawUseBox(cp_Draw[8], 1);
- TextDrawBoxColor(cp_Draw[8], 68);
- TextDrawTextSize(cp_Draw[8], 12.000000, 10.000000);
- TextDrawSetSelectable(cp_Draw[8], true);
- cp_Draw[9] = TextDrawCreate(390.000000, 220.000000, ">"); // red
- TextDrawAlignment(cp_Draw[9], 2);
- TextDrawBackgroundColor(cp_Draw[9], 255);
- TextDrawFont(cp_Draw[9], 1);
- TextDrawLetterSize(cp_Draw[9], 0.230000, 0.999998);
- TextDrawColor(cp_Draw[9], -1);
- TextDrawSetOutline(cp_Draw[9], 0);
- TextDrawSetProportional(cp_Draw[9], 1);
- TextDrawSetShadow(cp_Draw[9], 1);
- TextDrawUseBox(cp_Draw[9], 1);
- TextDrawBoxColor(cp_Draw[9], 68);
- TextDrawTextSize(cp_Draw[9], 12.000000, 10.000000);
- TextDrawSetSelectable(cp_Draw[9], true);
- cp_Draw[10] = TextDrawCreate(355.000000, 240.000000, "<"); // blue
- TextDrawAlignment(cp_Draw[10], 2);
- TextDrawBackgroundColor(cp_Draw[10], 255);
- TextDrawFont(cp_Draw[10], 1);
- TextDrawLetterSize(cp_Draw[10], 0.230000, 0.999998);
- TextDrawColor(cp_Draw[10], -1);
- TextDrawSetOutline(cp_Draw[10], 0);
- TextDrawSetProportional(cp_Draw[10], 1);
- TextDrawSetShadow(cp_Draw[10], 1);
- TextDrawUseBox(cp_Draw[10], 1);
- TextDrawBoxColor(cp_Draw[10], 68);
- TextDrawTextSize(cp_Draw[10], 12.000000, 10.000000);
- TextDrawSetSelectable(cp_Draw[10], true);
- cp_Draw[11] = TextDrawCreate(355.000000, 260.000000, "<"); // green
- TextDrawAlignment(cp_Draw[11] , 2);
- TextDrawBackgroundColor(cp_Draw[11] , 255);
- TextDrawFont(cp_Draw[11] , 1);
- TextDrawLetterSize(cp_Draw[11] , 0.230000, 0.999998);
- TextDrawColor(cp_Draw[11] , -1);
- TextDrawSetOutline(cp_Draw[11] , 0);
- TextDrawSetProportional(cp_Draw[11] , 1);
- TextDrawSetShadow(cp_Draw[11] , 1);
- TextDrawUseBox(cp_Draw[11] , 1);
- TextDrawBoxColor(cp_Draw[11] , 68);
- TextDrawTextSize(cp_Draw[11] , 12.000000, 10.000000);
- TextDrawSetSelectable(cp_Draw[11], true);
- cp_Draw[12] = TextDrawCreate(390.000000, 240.000000, ">"); // blue
- TextDrawAlignment(cp_Draw[12], 2);
- TextDrawBackgroundColor(cp_Draw[12], 255);
- TextDrawFont(cp_Draw[12], 1);
- TextDrawLetterSize(cp_Draw[12], 0.230000, 0.999998);
- TextDrawColor(cp_Draw[12], -1);
- TextDrawSetOutline(cp_Draw[12], 0);
- TextDrawSetProportional(cp_Draw[12], 1);
- TextDrawSetShadow(cp_Draw[12], 1);
- TextDrawUseBox(cp_Draw[12], 1);
- TextDrawBoxColor(cp_Draw[12], 68);
- TextDrawTextSize(cp_Draw[12], 12.000000, 10.000000);
- TextDrawSetSelectable(cp_Draw[12], true);
- cp_Draw[13] = TextDrawCreate(390.000000, 260.000000, ">"); // green
- TextDrawAlignment(cp_Draw[13], 2);
- TextDrawBackgroundColor(cp_Draw[13], 255);
- TextDrawFont(cp_Draw[13], 1);
- TextDrawLetterSize(cp_Draw[13], 0.230000, 0.999998);
- TextDrawColor(cp_Draw[13], -1);
- TextDrawSetOutline(cp_Draw[13], 0);
- TextDrawSetProportional(cp_Draw[13], 1);
- TextDrawSetShadow(cp_Draw[13], 1);
- TextDrawUseBox(cp_Draw[13], 1);
- TextDrawBoxColor(cp_Draw[13], 68);
- TextDrawTextSize(cp_Draw[13], 12.000000, 10.000000);
- TextDrawSetSelectable(cp_Draw[13], true);
- cp_Draw[14] = TextDrawCreate(416.000000, 190.000000, "x"); // cancel
- TextDrawAlignment(cp_Draw[14], 2);
- TextDrawBackgroundColor(cp_Draw[14], 255);
- TextDrawFont(cp_Draw[14], 2);
- TextDrawLetterSize(cp_Draw[14], 0.199999, 0.699998);
- TextDrawColor(cp_Draw[14], -1);
- TextDrawSetOutline(cp_Draw[14], 0);
- TextDrawSetProportional(cp_Draw[14], 1);
- TextDrawSetShadow(cp_Draw[14], 1);
- TextDrawUseBox(cp_Draw[14], 1);
- TextDrawBoxColor(cp_Draw[14], 68);
- TextDrawTextSize(cp_Draw[14], 12.000000, 8.000000);
- TextDrawSetSelectable(cp_Draw[14], true);
- cp_Draw[15] = TextDrawCreate(409.000000, 271.000000, "OK"); // okey
- TextDrawAlignment(cp_Draw[15], 2);
- TextDrawBackgroundColor(cp_Draw[15], 0);
- TextDrawFont(cp_Draw[15], 1);
- TextDrawLetterSize(cp_Draw[15], 0.230000, 0.999998);
- TextDrawColor(cp_Draw[15], -1);
- TextDrawSetOutline(cp_Draw[15], 0);
- TextDrawSetProportional(cp_Draw[15], 1);
- TextDrawSetShadow(cp_Draw[15], 1);
- TextDrawUseBox(cp_Draw[15], 1);
- TextDrawBoxColor(cp_Draw[15], 68);
- TextDrawTextSize(cp_Draw[15], 12.000000, 12.000000);
- TextDrawSetSelectable(cp_Draw[15], true);
- // end clickable
- cp_Draw[16] = TextDrawCreate(300.000000, 231.000000, "~r~~h~~h~-"); // pasek pod 'RED'
- TextDrawBackgroundColor(cp_Draw[16], 16);
- TextDrawFont(cp_Draw[16], 1);
- TextDrawLetterSize(cp_Draw[16], 7.899997, 0.699998);
- TextDrawColor(cp_Draw[16], -1);
- TextDrawSetOutline(cp_Draw[16], 1);
- TextDrawSetProportional(cp_Draw[16], 1);
- cp_Draw[17] = TextDrawCreate(300.000000, 251.000000, "~g~~h~~h~-"); // pasek pod 'BLUE'
- TextDrawBackgroundColor(cp_Draw[17], 16);
- TextDrawFont(cp_Draw[17], 1);
- TextDrawLetterSize(cp_Draw[17], 7.899997, 0.699998);
- TextDrawColor(cp_Draw[17], -1);
- TextDrawSetOutline(cp_Draw[17], 1);
- TextDrawSetProportional(cp_Draw[17], 1);
- // credits
- cp_Draw[18] = TextDrawCreate(218.000000, 278.000000, "Code by Maku123 | Design by AXV");
- TextDrawBackgroundColor(cp_Draw[18], 1);
- TextDrawFont(cp_Draw[18], 1);
- TextDrawLetterSize(cp_Draw[18], 0.119998, 0.399998);
- TextDrawColor(cp_Draw[18], -1);
- TextDrawSetOutline(cp_Draw[18], 1);
- TextDrawSetProportional(cp_Draw[18], 1);
- return 1;
- }
- UnLoadColorPicker() {
- for(new i = GetMaxPlayers() - 1; i >= 0; --i) if (IsPlayerConnected (i)) {
- HidePlayerColorPicker(i);
- PlayerTextDrawDestroy(i, cp_playerDraw[i][0]);
- PlayerTextDrawDestroy(i, cp_playerDraw[i][1]);
- PlayerTextDrawDestroy(i, cp_playerDraw[i][2]);
- PlayerTextDrawDestroy(i, cp_playerDraw[i][3]);
- }
- for(new i; i < sizeof (cp_Draw); i++) {
- TextDrawDestroy(cp_Draw[i]);
- }
- return 1;
- }
- /*
- Poprawka #1
- - Poprawiono CP_OnPlayerKeyStateChange(playerid, _:clickedid); na forward CP_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
- */
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
- if ((newkeys & 16) && ChooseColor[playerid][COLOR_PICKER_ID] != -1) {
- HidePlayerColorPicker(playerid, true, 1);
- }
- CallLocalFunction("CP_OnPlayerKeyStateChange", "ddd", playerid, newkeys, oldkeys);
- return 1;
- }
- #if defined _ALS_OnPlayerKeyStateChange
- #undef OnPlayerKeyStateChange
- #else
- #define _ALS_OnPlayerKeyStateChange
- #endif
- #define OnPlayerKeyStateChange CP_OnPlayerKeyStateChange
- forward CP_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
- /*
- Notatka
- #AXV
- Robiąc textdrawy niezauwazylem czegos takiego jak 'alpha' - powininem dodac w kolejnej wersji releasu
- */
- public OnPlayerClickTextDraw(playerid, Text:clickedid) {
- if (ChooseColor[playerid][COLOR_PICKER_ID] != -1) {
- if (clickedid == cp_Draw[14] || clickedid == Text:INVALID_TEXT_DRAW) { // button 'X'
- HidePlayerColorPicker(playerid, true, 0);
- }
- else if (clickedid == cp_Draw[15]) { // button 'OK'
- HidePlayerColorPicker(playerid, true, 1);
- } else {
- if (clickedid == cp_Draw[8]) ChooseColor[playerid][COLOR_PICKER_RED] -= 5;
- if (clickedid == cp_Draw[11]) ChooseColor[playerid][COLOR_PICKER_GREEN] -= 5;
- if (clickedid == cp_Draw[10]) ChooseColor[playerid][COLOR_PICKER_BLUE] -= 5;
- //if (clickedid == cp_Draw[8]) ChooseColor[playerid][COLOR_PICKER_ALPHA] -= 5;
- if (clickedid == cp_Draw[9]) ChooseColor[playerid][COLOR_PICKER_RED] += 5;
- if (clickedid == cp_Draw[13]) ChooseColor[playerid][COLOR_PICKER_GREEN] += 5;
- if (clickedid == cp_Draw[12]) ChooseColor[playerid][COLOR_PICKER_BLUE] += 5;
- //if (clickedid == cp_Draw[12]) ChooseColor[playerid][COLOR_PICKER_ALPHA] += 5;
- ColorPicker_RefreshColor(playerid, ChooseColor[playerid][COLOR_PICKER_ALPHA_ENABLE]);
- }
- }
- CallLocalFunction("CP_OnPlayerClickTextDraw", "dd", playerid, _:clickedid);
- return 1;
- }
- #if defined _ALS_OnPlayerClickTextDraw
- #undef OnPlayerClickTextDraw
- #else
- #define _ALS_OnPlayerClickTextDraw
- #endif
- #define OnPlayerClickTextDraw CP_OnPlayerClickTextDraw
- forward CP_OnPlayerClickTextDraw(playerid, _:clickedid);
- stock HidePlayerColorPicker(playerid, bool:call_callback = false, call_response = 0) {
- for (new i; i < sizeof cp_Draw; i++) {
- TextDrawHideForPlayer(playerid, cp_Draw[i]);
- }
- if (call_callback) {
- new color = RGBAToHex(ChooseColor[playerid][COLOR_PICKER_RED],ChooseColor[playerid][COLOR_PICKER_GREEN],ChooseColor[playerid][COLOR_PICKER_BLUE],ChooseColor[playerid][COLOR_PICKER_ALPHA]);
- CallRemoteFunction("OnColorPickerResponse", "dddd", playerid, ChooseColor[playerid][COLOR_PICKER_ID], color, call_response);
- }
- ChooseColor[playerid][COLOR_PICKER_ID] = -1;
- PlayerTextDrawHide(playerid, cp_playerDraw[playerid][0]);
- PlayerTextDrawHide(playerid, cp_playerDraw[playerid][1]);
- PlayerTextDrawHide(playerid, cp_playerDraw[playerid][2]);
- PlayerTextDrawHide(playerid, cp_playerDraw[playerid][3]);
- CancelSelectTextDraw(playerid);
- return 1;
- }
- stock ShowPlayerColorPicker(playerid, pickerid, bool:showalpha = false, bool:showcancel = true) {
- ChooseColor[playerid][COLOR_PICKER_ID] = pickerid;
- ChooseColor[playerid][COLOR_PICKER_RED] = 155;
- ChooseColor[playerid][COLOR_PICKER_GREEN] = 155;
- ChooseColor[playerid][COLOR_PICKER_BLUE] = 155;
- ChooseColor[playerid][COLOR_PICKER_ALPHA] = 255;
- ChooseColor[playerid][COLOR_PICKER_ALPHA_ENABLE] = showalpha;
- for (new i; i < sizeof cp_Draw; i++) {
- // tymczasowo wylaczamy opcje alpha
- /*if (i == 15 && showalpha == true) continue;
- if (i == 3 && showalpha == false) continue;
- if (i == 8 && showalpha == false) continue;
- if (i == 12 && showalpha == false) continue;*/
- if (i == 14 && showcancel == false) continue;
- TextDrawShowForPlayer(playerid, cp_Draw[i]);
- }
- ColorPicker_RefreshColor(playerid, showalpha);
- SelectTextDraw(playerid, 0x5EBAF2FF);
- return 1;
- }
- stock ColorPicker_RefreshColor(playerid, showalpha) {
- if (ChooseColor[playerid][COLOR_PICKER_RED] > 255) ChooseColor[playerid][COLOR_PICKER_RED] = 0;
- if (ChooseColor[playerid][COLOR_PICKER_RED] < 0) ChooseColor[playerid][COLOR_PICKER_RED] = 255;
- if (ChooseColor[playerid][COLOR_PICKER_GREEN] > 255) ChooseColor[playerid][COLOR_PICKER_GREEN] = 0;
- if (ChooseColor[playerid][COLOR_PICKER_GREEN] < 0) ChooseColor[playerid][COLOR_PICKER_GREEN] = 255;
- if (ChooseColor[playerid][COLOR_PICKER_BLUE] > 255) ChooseColor[playerid][COLOR_PICKER_BLUE] = 0;
- if (ChooseColor[playerid][COLOR_PICKER_BLUE] < 0) ChooseColor[playerid][COLOR_PICKER_BLUE] = 255;
- // if (ChooseColor[playerid][COLOR_PICKER_ALPHA] > 255) ChooseColor[playerid][COLOR_PICKER_ALPHA] = 0;
- // if (ChooseColor[playerid][COLOR_PICKER_ALPHA] < 0) ChooseColor[playerid][COLOR_PICKER_ALPHA] = 255;
- new color = RGBAToHex(ChooseColor[playerid][COLOR_PICKER_RED],ChooseColor[playerid][COLOR_PICKER_GREEN],ChooseColor[playerid][COLOR_PICKER_BLUE],ChooseColor[playerid][COLOR_PICKER_ALPHA]);
- PlayerTextDrawBoxColor(playerid, cp_playerDraw[playerid][0], color);
- PlayerTextDrawShow(playerid, cp_playerDraw[playerid][0]);
- new buf[10];
- if (showalpha) {
- format (buf, sizeof (buf), "%d", ChooseColor[playerid][COLOR_PICKER_RED]);
- PlayerTextDrawSetString(playerid, cp_playerDraw[playerid][1], buf);
- format (buf, sizeof (buf), "%d", ChooseColor[playerid][COLOR_PICKER_BLUE]);
- PlayerTextDrawSetString(playerid, cp_playerDraw[playerid][2], buf);
- format (buf, sizeof (buf), "%d", ChooseColor[playerid][COLOR_PICKER_GREEN]);
- PlayerTextDrawSetString(playerid, cp_playerDraw[playerid][3], buf);
- } else {
- format (buf, sizeof (buf), "%d", ChooseColor[playerid][COLOR_PICKER_RED]);
- PlayerTextDrawSetString(playerid, cp_playerDraw[playerid][1], buf);
- format (buf, sizeof (buf), "%d", ChooseColor[playerid][COLOR_PICKER_BLUE]);
- PlayerTextDrawSetString(playerid, cp_playerDraw[playerid][2], buf);
- format (buf, sizeof (buf), "%d", ChooseColor[playerid][COLOR_PICKER_GREEN]);
- PlayerTextDrawSetString(playerid, cp_playerDraw[playerid][3], buf);
- }
- PlayerTextDrawShow(playerid, cp_playerDraw[playerid][1]);
- PlayerTextDrawShow(playerid, cp_playerDraw[playerid][2]);
- PlayerTextDrawShow(playerid, cp_playerDraw[playerid][3]);
- return 1;
- }
- public OnPlayerConnect(playerid) {
- ChooseColor[playerid][COLOR_PICKER_ID] = -1;
- cp_playerDraw[playerid][0] = CreatePlayerTextDraw(playerid,269.000000, 233.000000, "_");
- PlayerTextDrawAlignment(playerid,cp_playerDraw[playerid][0], 2);
- PlayerTextDrawBackgroundColor(playerid,cp_playerDraw[playerid][0], 255);
- PlayerTextDrawFont(playerid,cp_playerDraw[playerid][0], 1);
- PlayerTextDrawLetterSize(playerid,cp_playerDraw[playerid][0], 0.500000, 4.000000);
- PlayerTextDrawColor(playerid,cp_playerDraw[playerid][0], 16711935);
- PlayerTextDrawSetOutline(playerid,cp_playerDraw[playerid][0], 0);
- PlayerTextDrawSetProportional(playerid,cp_playerDraw[playerid][0], 1);
- PlayerTextDrawSetShadow(playerid,cp_playerDraw[playerid][0], 1);
- PlayerTextDrawUseBox(playerid,cp_playerDraw[playerid][0], 1);
- PlayerTextDrawBoxColor(playerid,cp_playerDraw[playerid][0], 16711935);
- PlayerTextDrawTextSize(playerid,cp_playerDraw[playerid][0], 289.000000, 60.000000);
- cp_playerDraw[playerid][1] = CreatePlayerTextDraw(playerid, 373.000000, 221.000000, "155");
- PlayerTextDrawAlignment(playerid,cp_playerDraw[playerid][1], 2);
- PlayerTextDrawBackgroundColor(playerid,cp_playerDraw[playerid][1], 1);
- PlayerTextDrawFont(playerid,cp_playerDraw[playerid][1], 2);
- PlayerTextDrawLetterSize(playerid,cp_playerDraw[playerid][1], 0.159999, 0.799998);
- PlayerTextDrawColor(playerid,cp_playerDraw[playerid][1], -1);
- PlayerTextDrawSetOutline(playerid,cp_playerDraw[playerid][1], 1);
- PlayerTextDrawSetProportional(playerid,cp_playerDraw[playerid][1], 1);
- cp_playerDraw[playerid][2] = CreatePlayerTextDraw(playerid, 373.000000, 241.000000, "155");
- PlayerTextDrawAlignment(playerid, cp_playerDraw[playerid][2], 2);
- PlayerTextDrawBackgroundColor(playerid, cp_playerDraw[playerid][2], 1);
- PlayerTextDrawFont(playerid, cp_playerDraw[playerid][2], 2);
- PlayerTextDrawLetterSize(playerid, cp_playerDraw[playerid][2], 0.159999, 0.799998);
- PlayerTextDrawColor(playerid, cp_playerDraw[playerid][2], -1);
- PlayerTextDrawSetOutline(playerid, cp_playerDraw[playerid][2], 1);
- PlayerTextDrawSetProportional(playerid, cp_playerDraw[playerid][2], 1);
- cp_playerDraw[playerid][3] = CreatePlayerTextDraw(playerid,373.000000, 261.000000, "155");
- PlayerTextDrawAlignment(playerid,cp_playerDraw[playerid][3], 2);
- PlayerTextDrawBackgroundColor(playerid,cp_playerDraw[playerid][3], 1);
- PlayerTextDrawFont(playerid,cp_playerDraw[playerid][3], 2);
- PlayerTextDrawLetterSize(playerid,cp_playerDraw[playerid][3], 0.159999, 0.799998);
- PlayerTextDrawColor(playerid,cp_playerDraw[playerid][3], -1);
- PlayerTextDrawSetOutline(playerid,cp_playerDraw[playerid][3], 1);
- PlayerTextDrawSetProportional(playerid,cp_playerDraw[playerid][3], 1);
- CallLocalFunction("ColorPicker_OnPlayerConnect", "dd", playerid);
- return 1;
- }
- #if defined _ALS_OnPlayerConnect
- #undef OnPlayerConnect
- #else
- #define _ALS_OnPlayerConnect
- #endif
- #define OnPlayerConnect ColorPicker_OnPlayerConnect
- forward ColorPicker_OnPlayerConnect(playerid);
- public OnPlayerDisconnect(playerid, reason) {
- PlayerTextDrawDestroy(playerid, cp_playerDraw[playerid][0]);
- PlayerTextDrawDestroy(playerid, cp_playerDraw[playerid][1]);
- PlayerTextDrawDestroy(playerid, cp_playerDraw[playerid][2]);
- PlayerTextDrawDestroy(playerid, cp_playerDraw[playerid][3]);
- CallLocalFunction("ColorPicker_OnPlayerDisconnect", "dd", playerid, reason);
- return 1;
- }
- #if defined _ALS_OnPlayerDisconnect
- #undef OnPlayerDisconnect
- #else
- #define _ALS_OnPlayerDisconnect
- #endif
- #define OnPlayerDisconnect ColorPicker_OnPlayerDisconnect
- forward ColorPicker_OnPlayerDisconnect(playerid, reason);
- #if defined FILTERSCRIPT
- public OnFilterScriptInit() {
- LoadColorPicker();
- CallLocalFunction("ColorPicker_OnFilterScriptInit", "");
- return 1;
- }
- #if defined _ALS_OnFilterScriptInit
- #undef OnFilterScriptInit
- #else
- #define _ALS_OnFilterScriptInit
- #endif
- #define OnFilterScriptInit ColorPicker_OnFilterScriptInit
- forward ColorPicker_OnFilterScriptInit();
- public OnFilterScriptExit() {
- UnLoadColorPicker();
- CallLocalFunction("ColorPicker_OnFilterScriptExit", "");
- return 1;
- }
- #if defined _ALS_OnFilterScriptExit
- #undef OnFilterScriptExit
- #else
- #define _ALS_OnFilterScriptExit
- #endif
- #define OnFilterScriptExit ColorPicker_OnFilterScriptExit
- forward ColorPicker_OnFilterScriptExit();
- #else
- public OnGameModeInit() {
- LoadColorPicker();
- CallLocalFunction("ColorPicker_OnGameModeInit", "");
- return 1;
- }
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit ColorPicker_OnGameModeInit
- forward ColorPicker_OnGameModeInit();
- public OnGameModeExit() {
- UnLoadColorPicker();
- CallLocalFunction("ColorPicker_OnGameModeExit", "");
- return 1;
- }
- #if defined _ALS_OnGameModeExit
- #undef OnGameModeExit
- #else
- #define _ALS_OnGameModeExit
- #endif
- #define OnGameModeExit ColorPicker_OnGameModeExit
- forward ColorPicker_OnGameModeExit();
- #endif
Advertisement
Add Comment
Please, Sign In to add comment