Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: megafon
1. Megafon SAPD
Witam, chcia?bym stworzy? megafon dla SAPD, mam ju? kod lua, ale co? gdy wpisuje komende to mi nie dzia?a, dlatego pisz? do was pro?b? o pomoc


function megafon(plrcmd, ...)
    if 
not ... then return end
    
if getElementData(plr,'player:faction') == 'SAPD' then
     local text 
table.concat({...}, " ")
        
local posXposYposZ=getElementPosition(plr)
        
local sphere=createColSphereposXposYposZ55)
        
local nearbyPlayers=getElementsWithinColShape(sphere'player')
        
destroyElement(sphere)
        for 
indexplayer in ipairsnearbyPlayers ) do
            
outputChatBox('[POLICJA] Megafon: '..text..'!'player2552550)
        
end
    end
end
addCommandHandler
('meg'megafon)
2. Megafon w SAPD.
Witam, megafon dzia?a ale.

Jak wpisz? /meg sta? tutaj..........

to pojawia si? tylko [POLICJA] sta?!!

a nie ca?e zdanie.

a jak wpisez stac-tutaj

to juz wszystko okej

jakies porady?

kod to


function megafon(plrcmdmsg)
    if 
not msg then return end
    
if getElementData(plr,'player:duty') == 'SAPD' then
        local posX
posYposZ=getElementPosition(plr)
        
local sphere=createColSphereposXposYposZ55)
        
local nearbyPlayers=getElementsWithinColShape(sphere'player')
        
destroyElement(sphere)
        for 
indexplayer in ipairsnearbyPlayers ) do
            
outputChatBox('[POLICJA] Megafon: '..msg..'!'player2552550)
        
end
    end
end
addCommandHandler
('meg'megafon)