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: poli
1. kolczatka dla poli
Witam zrobi?em skrypt na kolczatke poli lecz gdy j? postawie auto po niej przejedzie to opony si? nie rozwalaj? co robi?.
Kod;

 
function barier(plr) 
    if 
getElementModel(plr) ~= 280 then return end
    
    local x
,y,z = getElementPosition(plr)
    
local rx,ry,rz = getElementRotation(plr)
        
    
local barierka = createObject(2892, x,y,z-0.7)
    
setElementData(barierka, "isBarierka", true)
    
setElementRotation(barierka, rx, ry, rz+90)
    
setElementFrozen(barierka, false)
    
    
setElementData(barierka, "isBarierka2", getPlayerName(plr))
end
addCommandHandler
("kol",barier )
    
function 
barier(plr) 
    if 
getElementModel(plr) ~= 280 then return end
    
for i,v in ipairs(getElementsByType("object", resourceRoot)) do
      if 
not getElementData(v, "isBarierka") then return end
      
if getElementData(v, "isBarierka2") == getPlayerName(plr) then
        destroyElement
(v)
     
end
   end
 end
 addCommandHandler
("usb", barier)

Za pomoc stawiam :piwo: :piwo: :piwo: :piwo: :piwo: :piwo:
2. Panel Poli
Siema

M?j problem na dzi? to, label i brak w nim informacji o kt?re prosz?...
A mianowicie, mam sobie gui w kt?rym stworzy?em pusty label. Chc? aby po wybraniu gracza z listy pojawia? si? jego nick w tym labelu. Pokarz? kod.

addEventHandler("onClientGUIClick",root,
    function ()
        if ( 
source == GUIEditor_Grid[1] ) then
            local sel 
= guiGridListGetSelectedItem(grid)
            
local text = guiGridListGetItemText(grid,sel,1)
            
local player = getPlayerFromName(text)
            if ( 
player ) then
                guiSetText
(GUIEditor_Label[1],"Nick: " .. getPlayerName(player))
                            else
                
guiSetText(GUIEditor_Label[1],"Nick: N/A")
            
end
        end
    end
)


Teraz jak wybior? gracza wy?wietla si? tylko "Nick: N/A"
Co robi? ?le?