Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- VIP Color by Джо
- Contine comenzile: /vipcolor
- Comanda a fost trecuta pe procesorul ZCMD.
- */
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define SCM SendClientMessage
- new CULOARE[MAX_PLAYERS];
- enum {
- DIALOG_VIPCOLOR
- };
- forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
- public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- //radi = 2.0; //Trigger Radius
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
- {
- SendClientMessage(i, col1, string);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
- {
- SendClientMessage(i, col2, string);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
- {
- SendClientMessage(i, col3, string);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
- {
- SendClientMessage(i, col4, string);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- SendClientMessage(i, col5, string);
- }
- }
- }
- }//not connected
- return 1;
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" VIP Color by Joe Vitollo aka Джо");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- CULOARE[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- CULOARE[playerid] = 0;
- SCM(playerid, -1, "Ai murit.Acum ai culoarea ta default la scris.");
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new string[360], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- if(CULOARE[playerid] == 1)
- {
- format(string, sizeof(string), "{FFFFFF}%s spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 2)
- {
- format(string, sizeof(string), "{00FF00}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 3)
- {
- format(string, sizeof(string), "{009933}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 4)
- {
- format(string, sizeof(string), "{FF0000}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 5)
- {
- format(string, sizeof(string), "{660033}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 6)
- {
- format(string, sizeof(string), "{CC00FF}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 7)
- {
- format(string, sizeof(string), "{00CCFF}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 8)
- {
- format(string, sizeof(string), "{3333FF}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 9)
- {
- format(string, sizeof(string), "{FFCC00}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 10)
- {
- format(string, sizeof(string), "{FF9900}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 11)
- {
- format(string, sizeof(string), "{FFFF00}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 12)
- {
- format(string, sizeof(string), "{FFFF33}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 13)
- {
- format(string, sizeof(string), "{FF00CC}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 14)
- {
- format(string, sizeof(string), "{99FF00}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 15)
- {
- format(string, sizeof(string), "{990099}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 16)
- {
- format(string, sizeof(string), "{99FF00}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 17)
- {
- format(string, sizeof(string), "{FFFF66}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- else if(CULOARE[playerid] == 18)
- {
- format(string, sizeof(string), "{66FFFF}%s{FFFFFF} spune: %s", name, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- }
- return 1;
- }
- CMD:vipcolor(playerid, params[])
- {
- ShowPlayerDialog(playerid, DIALOG_VIPCOLOR, DIALOG_STYLE_LIST, "VIP COLOR", "{FFFFFF}White\n{00FF00}Lime Green\n{009933}Green\n{FF0000}Red\n{660033}Unsual Red\n{CC00FF}Purple\n{00CCFF}Blue\n{3333FF}Dark Blue\n{FFCC00}Orange\n{FF9900}Deep Orange\n{FFFF00}Gold\n{FFFF33}Yellow\n{FF00CC}Pink\n{99FF00}Unsual Green\n{990099}Violet\n{99FF66}Unsual Green 2\n{FFFF66}Deep Yellow\n{66FFFF}Aqua Blue", "Select", "Cancel");
- return 1;
- }
- CMD:qcolor(playerid, params[])
- {
- CULOARE[playerid] = 0;
- SCM(playerid, -1, "Comanda executata cu succes.");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_VIPCOLOR)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- CULOARE[playerid] = 1;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 1:
- {
- CULOARE[playerid] = 2;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 2:
- {
- CULOARE[playerid] = 3;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 3:
- {
- CULOARE[playerid] = 4;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 4:
- {
- CULOARE[playerid] = 5;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 5:
- {
- CULOARE[playerid] = 6;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 6:
- {
- CULOARE[playerid] = 7;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 7:
- {
- CULOARE[playerid] = 8;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 8:
- {
- CULOARE[playerid] = 9;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 9:
- {
- CULOARE[playerid] = 10;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 10:
- {
- CULOARE[playerid] = 11;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 11:
- {
- CULOARE[playerid] = 12;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 12:
- {
- CULOARE[playerid] = 13;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 13:
- {
- CULOARE[playerid] = 14;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 14:
- {
- CULOARE[playerid] = 15;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 15:
- {
- CULOARE[playerid] = 16;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 16:
- {
- CULOARE[playerid] = 17;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- case 17:
- {
- CULOARE[playerid] = 18;
- SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
- }
- }
- }
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement