skad po stronie serwera zmienna "Client "?
Kod bez sensu w ogole
Tiger po stronie clienta zamiast resourceRoot wpisz target a po stronie serwera u?yj source kt?re zwroci ci juz gracza kt?ry lezy
Nie rob komend po stronie clienta je?li nie jest to wymagane, z argument?w komendy usun plr, bo nie zwraca ci to nic zobavz sobie na wiki. Gracz jako ty po stronie serwera jest zwracany jako localPlayer
Jak nie uda Ci si?, to po 13 bede w domu to edytuje ci to na kompie
[ Dodano: 2020-07-10, 14:00 ]
Client side :
addCommandHandler("podnies",function(cmd,cel)
if getElementData(localPlayer,"player:faction") == "SAMC" then
if not cel then outputChatBox("/podnies <ID>",255,255,255,true) return end
local target=exports["pystories-core"]:findPlayer(localPlayer,cel)
if not target then outputChatBox("/podnies <ID>",255,255,255,true) return end
outputChatBox("Podnoszenie",255,255,255,true)
setTimer(function()
outputChatBox("Podniesiono gracza "..getPlayerName(target):gsub("#%x%x%x%x%x%x",""),255,255,255,true)
triggerServerEvent("bw.end",target)
end,2000,1)
else
return
end
end)
server side :
addEvent("bw.end",true);
addEventHandler("bw.end",resourceRoot,function()
local x,y,z = getElementPosition(source);
local dim,int,skin = getElementDimension(source),getElementInterior(source),getElementModel(source);
setElementData(source,"player:bw",false)
spawnPlayer(source,x,y,z,0,skin,int,dim);
setElementHealth(source,45);
setPlayerHudComponentVisible ( source, "radar", true )
end)
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