function start()
mysliwystart=createMarker(-1632.57, -2245.49, 31.48-1,"cylinder",1.5,0,255,0,170)
code="Mysliwy"
miejsce=createColSphere(-1632.57, -2245.49, 31.48,600)
end
createBlip(-1632.57, -2245.49, 31.48,46)
start()
function MarkerHit(el,md)
if source==mysliwystart then
if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
job=getElementData(el,"player:job")
if job then
if job==code then
data=getElementData(el,"MysliwyStrzelanie")
if data then
takeWeapon(el,33,1000)
toggleControl(el,"fire",data.fire)
toggleControl(el,"aim_weapon",data.aim)
toggleControl(el,"next_weapon",data.nexweapon)
toggleControl(el,"previous_weapon",data.prvweapon)
setElementData(el,"MysliwyStrzelanie",false,false)
setElementData(el,"player:job",false)
triggerClientEvent(el,"MysliwyStop",resourceRoot)
outputChatBox("Odda?e? bro?, praca zako?czona!",el,0,255,0)
end
end
return
end
if getElementData(el,"player:license:Strzelanie") == 0 then
outputChatBox("* Nie posiadasz zdanej licencji na bro?!", el, 255, 0, 0)
return
end
giveWeapon(el,33,1000)
setElementData(el,"MysliwyStrzelanie",{fire=isControlEnabled(el,"fire"),aim=isControlEnabled(el,"aim_weapon"),nexweapon=isControlEnabled(el,"next_weapon"),prvweapon=isControlEnabled(el,"previous_weapon")},false)
toggleControl(el,"fire",true)
toggleControl(el,"aim_weapon",true)
toggleControl(el,"next_weapon",true)
toggleControl(el,"previous_weapon",true)
setElementData(el,"player:job",code)
outputChatBox("Otrzyma?e? bro?, zacznij od poszukania zwierzyny.",el,0,255,0)
triggerClientEvent(el,"MysliwyStart",resourceRoot)
end
end
addEventHandler("onMarkerHit",resourceRoot,MarkerHit)
function onLeave(hitelement)
if getElementType(hitelement)=="player" and getElementData(hitelement,"player:job")==code then
removePedFromVehicle(hitelement)
setTimer(function(p)
setElementPosition(p,-1635.01, -2238.48, 31.48)
outputChatBox("Zbytnio oddali?e? si? od miejsca ?ow?w! Je?li chcesz zako?czy? prac?, wejd? w zielony marker!",p,255,0,0)
end,100,1,hitelement)
end
end
addEventHandler("onColShapeLeave",miejsce,onLeave)
function pedDmg(attacker)
if attacker==localPlayer then
source=getElementData(source,"parent")
if source and getElementData(source,"zwierze") then
wyplata=getElementData(source,"kasa")
outputChatBox("Otrzyma?e? "..wyplata.."PLN",0,255,0)
triggerClientEvent("prace:wyplata",getRootElement(),"mysliwy",wyplata)
id=getElementData(source,"id")
destroyElement(getElementData(source,"parent"))
destroyElement(source)
stworzZwierzeta(false,1,id)
aktualneZwierzeta[id]=nil
sfery[id]=nil
zajete[id]=nil
end
end
end
addEventHandler("onClientPedDamage",resourceRoot,pedDmg)
addEvent("prace:wyplata",true)
addEventHandler("prace:wyplata",root,function(ilosc)
givePlayerMoney(client,ilosc)
end)
function start()
mysliwystart=createMarker(-1632.57, -2245.49, 31.48-1,"cylinder",1.5,0,255,0,170)
code="Mysliwy"
miejsce=createColSphere(-1632.57, -2245.49, 31.48,600)
end
createBlip(-1632.57, -2245.49, 31.48,46)
start()
function MarkerHit(el,md)
if source==mysliwystart then
if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
job=getElementData(el,"player:job")
if job then
if job==code then
data=getElementData(el,"MysliwyStrzelanie")
if data then
takeWeapon(el,33,1000)
toggleControl(el,"fire",data.fire)
toggleControl(el,"aim_weapon",data.aim)
toggleControl(el,"next_weapon",data.nexweapon)
toggleControl(el,"previous_weapon",data.prvweapon)
setElementData(el,"MysliwyStrzelanie",false,false)
setElementData(el,"player:job",false)
triggerClientEvent(el,"MysliwyStop",resourceRoot)
outputChatBox("Odda?e? bro?, praca zako?czona!",el,0,255,0)
end
end
return
end
if getElementData(el,"player:license:Strzelanie") == 0 then
outputChatBox("* Nie posiadasz zdanej licencji na bro?!", el, 255, 0, 0)
return
end
giveWeapon(el,33,1000)
setElementData(el,"MysliwyStrzelanie",{fire=isControlEnabled(el,"fire"),aim=isControlEnabled(el,"aim_weapon"),nexweapon=isControlEnabled(el,"next_weapon"),prvweapon=isControlEnabled(el,"previous_weapon")},false)
toggleControl(el,"fire",true)
toggleControl(el,"aim_weapon",true)
toggleControl(el,"next_weapon",true)
toggleControl(el,"previous_weapon",true)
setElementData(el,"player:job",code)
outputChatBox("Otrzyma?e? bro?, zacznij od poszukania zwierzyny.",el,0,255,0)
triggerClientEvent(el,"MysliwyStart",resourceRoot)
end
end
addEventHandler("onMarkerHit",resourceRoot,MarkerHit)
function onLeave(hitelement)
if getElementType(hitelement)=="player" and getElementData(hitelement,"player:job")==code then
removePedFromVehicle(hitelement)
setTimer(function(p)
setElementPosition(p,-1635.01, -2238.48, 31.48)
outputChatBox("Zbytnio oddali?e? si? od miejsca ?ow?w! Je?li chcesz zako?czy? prac?, wejd? w zielony marker!",p,255,0,0)
end,100,1,hitelement)
end
end
addEventHandler("onColShapeLeave",miejsce,onLeave)
function pedDmg(attacker)
if attacker==localPlayer then
source=getElementData(source,"parent")
if source and getElementData(source,"zwierze") then
wyplata=getElementData(source,"kasa")
outputChatBox("Otrzyma?e? "..wyplata.."PLN",0,255,0)
triggerClientEvent("prace:wyplata",getRootElement(),"mysliwy",wyplata)
id=getElementData(source,"id")
destroyElement(getElementData(source,"parent"))
destroyElement(source)
stworzZwierzeta(false,1,id)
aktualneZwierzeta[id]=nil
sfery[id]=nil
zajete[id]=nil
end
end
end
addEventHandler("onClientPedDamage",resourceRoot,pedDmg)
addEvent("prace:wyplata",true)
addEventHandler("prace:wyplata",root,function(ilosc)
givePlayerMoney(client,ilosc)
end)
dodaj ten event po stronie 'server' i powinno by? spoko, aczkolwiek client w givePlayerMoney zamie? na localPlayer
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