Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Dieses Script wurde in 5 Minuten von DarkRaver gebaut !
- #include <a_samp>
- #define Farbe_Fade1 0xE6E6E6E6
- #define Farbe_Fade2 0xC8C8C8C8
- #define Farbe_Fade3 0xAAAAAAAA
- #define Farbe_Fade4 0x8C8C8C8C
- #define Farbe_Fade5 0x6E6E6E6E
- #define Farbe_Orange 0xFF9900FF
- new LocalChatOn[MAX_PLAYERS];
- new BigEar[MAX_PLAYERS];
- public OnPlayerConnect(playerid)
- {
- LocalChatOn[playerid] = 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(LocalChatOn[playerid] == 0)
- {
- new Nachricht[256];
- format(Nachricht, sizeof(Nachricht), "%s sagt an alle: %s", playerid, Nachricht);
- SendClientMessageToAll(Farbe_Fade1, Nachricht);
- }
- if(LocalChatOn[playerid] == 1)
- {
- new Nachricht[256];
- format(Nachricht, sizeof(Nachricht), "%s sagt: %s", playerid, Nachricht);
- ProxDetector(15.0, playerid, Nachricht,Farbe_Fade1,Farbe_Fade2,Farbe_Fade3,Farbe_Fade4,Farbe_Fade5);
- }
- return 0;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- if(strcmp(cmd,"/localchat",true) ==0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(LocalChatOn[playerid] == 1)
- {
- LocalChatOn[playerid] = 0;
- SendClientMessage(playerid, Farbe_Orange, "Dein Lokaler Chat wurde ausgeschaltet !");
- SendClientMessage(playerid, Farbe_Orange, "Wenn du jetzt etwas schreibst k๏ฟฝnnen es alle sehen !");
- }
- else
- {
- LocalChatOn[playerid] = 1;
- SendClientMessage(playerid, Farbe_Orange, "Dein Lokaler Chat wurde eingeschaltet !");
- SendClientMessage(playerid, Farbe_Orange, "Wenn du jetzt etwas schreibst k๏ฟฝnnen es nur die sehen, die in der Umgebung sind !");
- }
- }
- }
- }
- 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))
- {
- if(!BigEar[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);
- }
- }
- else
- {
- SendClientMessage(i, col1, string);
- }
- }
- }
- }//not connected
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement