Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2014-06-22, 12:28


Maciąg







Wiek: 26
Na forum: 4517 dni
Posty: 211
Nick w MP: Dawirzo

Piwa: 149

Respekt: 31

Elo, witam :D Jak zrobi? czat, tak aby nie by? ci?gle globalny, tylko jak kto? napisze wiadomo?? to wy?wietla si? tylko nad nim + na czacie osobom, kt?re s? w pobli?u, prosz? o gotowy skrypt (najlepiej) lub o r??nego rodzaju pomoc :D
Stawiam piwo, nawet za dobre ch?ci :)

:piwo: :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-22, 17:26


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

local chatRadius = 50
 
function sendMessageToNearbyPlayers ( message, messageType )
    if ( messageType == 0 ) then
        local posX, posY, posZ = getElementPosition ( source )
 
        local chatSphere = createColSphere ( posX, posY, posZ, chatRadius )
        local nearbyPlayers = getElementsWithinColShape ( chatSphere, "player" )
 local idplayer = getElementData ( source, "playerid" )  
     destroyElement ( chatSphere )
 
        for index, nearbyPlayer in ipairs( nearbyPlayers ) do
            local red, green, blue = getPlayerNametagColor ( source )
            local nick = getPlayerName ( source )
            --outputChatBox("["..tonumber(idplayer).."] "..nick..": #ffffff".. message, nearbyPlayer, red, green, blue, true )
            konto= getPlayerAccount ( source )
local idplayer = getElementData ( source, "playerid" )
        local r, g, b = getPlayerNametagColor(source)
    if isObjectInACLGroup  ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Admin" ) ) and r == 204 and g == 255 and b == 0 then
        cancelEvent ( )
        outputChatBox ( "#FFFF00["..tonumber(idplayer).."] #FFFF00ADMINISTRATOR #ffffff " .. getPlayerName ( source ) .. ":#FFFFFF " .. message, nearbyPlayer, r, g, b, true )
     elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "RCON" ) ) and r == 204 and g == 0 and b == 0 then   
        cancelEvent ( )
        r, g, b = getPlayerNametagColor(source)
        outputChatBox ( "#FFFF00["..tonumber(idplayer).."] #CC0000RCON #ffffff" .. getPlayerName ( source ) .. ":#FFFFFF " .. message, nearbyPlayer, r, g, b, true )
        
        elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "SSupport" ) ) and r == 255 and g == 0 and b == 255 then   
        cancelEvent ( )
        r, g, b = getPlayerNametagColor(source)
        outputChatBox ( "#ffffff["..tonumber(idplayer).."] #FF00FFSuper Support#ffffff " .. getPlayerName ( source ) .. ":#FFFFFF " .. message, nearbyPlayer, r, g, b, true )
        
        elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Support" ) ) and r == 204 and g == 102 and b == 0 then   
        cancelEvent ( )
        r, g, b = getPlayerNametagColor(source)
        outputChatBox ( "#ffffff["..tonumber(idplayer).."] #CC6600Support#ffffff " .. getPlayerName ( source ) .. ":#FFFFFF " .. message, nearbyPlayer, r, g, b, true )
        
        
    elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "VIP" ) ) then   
        cancelEvent ( )
        r, g, b = getPlayerNametagColor(source)
        outputChatBox ( "#FFFF00["..tonumber(idplayer).."] #FFFF00PREMIUM #ffffff|| " .. getPlayerName ( source ) .. ":#FFFFFF " .. message, nearbyPlayer, r, g, b, true )
        
    
        elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "SzefPolicji" ) ) and type == 0 and r == 0 and g == 0 and b == 255 then   
        cancelEvent ( )
        r, g, b = getPlayerNametagColor(source)
        outputChatBox ( "#0000FF[ #ff0000Szef Policji#0000FF ]#FFFFFF " .. getPlayerName ( source ) .. ": " .. message, nearbyPlayer, r, g, b, true )
        
        elseif getAccountData ( konto, "duty" ) then   
        cancelEvent ( )
        r, g, b = getPlayerNametagColor(source)
        outputChatBox ( "#ffffff["..tonumber(idplayer).."] #0000FFPolicja #FFFFFF " .. getPlayerName ( source ) .. ": " .. message, nearbyPlayer, r, g, b, true )
        
        elseif getAccountData ( konto, "mechanik" ) then
        cancelEvent ( )
        r, g, b = getPlayerNametagColor(source)
        outputChatBox ( "#ffffff["..tonumber(idplayer).."] #663300Mechanik #FFFFFF|| " .. getPlayerName ( source ) .. ": " .. message, nearbyPlayer, r, g, b, true )
        
        elseif getAccountData ( konto, "mduty" ) then
        cancelEvent ( )
        r, g, b = getPlayerNametagColor(source)
        outputChatBox ( "#ffffff["..tonumber(idplayer).."] #66CCFFDoktor #FFFFFF|| " .. getPlayerName ( source ) .. ": " .. message, nearbyPlayer, r, g, b, true )
        
                
        elseif getAccountData ( konto, "nduty" ) then
        cancelEvent ( )
        r, g, b = getPlayerNametagColor(source)
        outputChatBox ( "#ffffff["..tonumber(idplayer).."] #990099Newser#FFFFFF|| " .. getPlayerName ( source ) .. ": " .. message, nearbyPlayer, r, g, b, true )
    
    elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Everyone" ) ) then   
        cancelEvent ( )
        r, g, b = getPlayerNametagColor(source)
        outputChatBox ( "#ffffff["..tonumber(idplayer).."]#ffffff Gracz " .. getPlayerName ( source ) .. ":#ffffff " .. message, nearbyPlayer, r, g, b, true )


        
        end
        end
        cancelEvent ( )
    end
end
addEventHandler ( "onPlayerChat", getRootElement(), sendMessageToNearbyPlayers )



W kodzie s? r??ne urozmaicenia, gdy? wzi?ty jest z mojego serwera.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-22, 17:32


Maciąg







Wiek: 26
Na forum: 4517 dni
Posty: 211
Nick w MP: Dawirzo

Piwa: 149

Respekt: 31

Mog? wykorzysta? ten kod do swojego serwera? Je?li tak to dzi?kuj? ! Mo?na zamkn?? :)

Podpis
Status prac nad Time to play RPG 25%
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-22, 17:38


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Maci?g, tak mo?esz, jednak nie zmieniaj tre?ci kodu i nie nadawaj Sobie autora.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Tagi: czat
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku