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

Wysłany: 2012-12-15, 13:35


Abross







Wiek: 32
Na forum: 5124 dni
Posty: 2
Nick w MP: Abross



Respekt: 50

Witajcie dopiero co zaczynam z lua mysle ze nie poszed?em na wysok? wode . zrobi?em juz panel pd i wzorujac sie na nim chcialem zrobic cos dla pogotowia

Client Side:
Kod:


GUIEditor = {
gridlist = {},
}
GUIEditor.gridlist[1] = guiCreateGridList(616, 277, 176, 283, false)


local kolumna = guiGridListAddColumn(GUIEditor.gridlist[1],"Gracze",0.9)


bindKey("m", "down",
function ()
if (getPlayerTeam(getLocalPlayer()) == getTeamFromName("Pomoc Drogowa")) then
if (guiGetVisible(GUIEditor.gridlist[1]) == false) then
showCursor(true)
guiSetVisible(GUIEditor.gridlist[1], true)
if (kolumna) then
for id, player in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow(GUIEditor.gridlist[1])
guiGridListSetItemText(GUIEditor.gridlist[1], row, kolumna, getPlayerName(player), false, false)
end
end
else
guiSetVisible(GUIEditor.gridlist[1], false)
showCursor(false)
guiGridListClear(GUIEditor.gridlist[1])
end
end
end)

function lecz()
local player = guiGridListGetItemText (GUIEditor.gridlist[1], guiGridListGetSelectedItem (GUIEditor.gridlist[1]), 1)
triggerServerEvent("lecz", getRootElement(), player, getLocalPlayer(""))
end
addEventHandler( "onClientGUIClick", GUIEditor.gridlist[1], lecz )


Serwer side:
Kod:


addEvent("lecz", true)
addEventHandler("lecz", getRootElement(), function(player, potem)
local player = getPlayerFromName ( player )
takePlayerMoney ( player , 0 )
givePlayerMoney(potem, 0 )
local norm = getPedOccupiedVehicle(player)
getElementHealth(norm)
end)


W cliencie wszystko jest ok ale jak wcisne m poka?e mi gracza itd . Klikne na niego 2x i nic sie nie dzieje nie leczy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-12-15, 17:47


pidbulxd







Wiek: 28
Na forum: 5371 dni
Posty: 135
Nick w MP: Word

Piwa: 540

Respekt: 60

Prosze:
Server side:
addEvent("healp", true) 
addEventHandler("healp", getRootElement(), function(ja,player) 
local driver = getPlayerFromName ( player )
setElementHealth ( driver, 100 ) 
end)


Client side:
function show()
if getPlayerTeam(getLocalPlayer()) == getTeamFromName("Pogotowie") then
if guiGetVisible(NAZWAOKIENKA) then
close()
else
guiGridListClear(NAZWA GIRD LISTY)
local px, py, pz = getElementPosition(getLocalPlayer()) 
 for k,v in ipairs(getElementsByType("player")) do 
 local newx, newy, newz = getElementPosition(v) 
 local distance = getDistanceBetweenPoints3D(px, py, pz, newx, newy, newz) 
 if distance < 20 then
 local row = guiGridListAddRow ( NAZWA GIRD LISTY] )
guiGridListSetItemText ( GUIEditor_Grid[1], row, kolumna, getPlayerName ( v ), false, false )
end
end
guiSetVisible(NAZWA OKIENKA, true)
showCursor(true)        
end
end
end
bindKey ("m","down",show)

---leczenie

function heal()
    local player = guiGridListGetItemText (NAZWA GIRD LISTY, guiGridListGetSelectedItem (NAZWA GIRD LISTY), 1) 
    triggerServerEvent("healp", getRootElement(),getLocalPlayer(), player)
end


addEventHandler( "onClientGUIClick", NAZWA PRZYCISKU, heal, false )

Jeszcze jakie? problemy, pisz gg:3689199

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: pogotowia
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Panel pogotowia ?? 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