function policja(plr)
uid=getElementData(plr,'player:sid')
if not uid then return end
if getElementData(plr,"player:faction") then
return outputChatBox("Nie mo?esz tego zrobi?!",plr,255,0,0)
end
a=(getElementData(plr,"antySpamzgloszenia") or 0)+60000
b=getTickCount()
if a>b then
return outputChatBox("Nie tak szybko! Poczekaj chwile z tymi zawiadomieniami (Poczekaj: "..math.floor((a-b)/1000).."s)",plr,255,0,0)
end
x,y,z=getElementPosition(plr)
miejsce=getZoneName(x,y,z)
dokladne=getZoneName(x,y,z,true)
exports["pystories-db"]:dbSet("insert into Zawiadomienia values(null,NOW(),?,?,?,?,?,0,0)",uid,getPlayerSerial(plr),miejsce,toJSON({x,y,z},true),"KGP")
for i,v in ipairs(getElementsByType("player")) do
if getElementData(v,"player:faction")=="KGP" then
outputChatBox(getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." wezwa? Policj?, jed? do "..dokladne.." ("..miejsce..") (ID: "..tostring(id)..")", v,0,0,255)
triggerClientEvent(v,"ZAWIADOMIENIA:SAPD:pokaz",resourceRoot,x,y,z,id)
end
end
setElementData(plr,"antySpamzgloszenia",getTickCount())
outputChatBox("Wezwa?e? policj?! Wkr?tce si? tu zjawi jaki? patrol!",plr,0,255,0)
end
addCommandHandler("997",policja)
function strazpozarna(plr)
uid=getElementData(plr,'player:sid')
if not uid then return end
if getElementData(plr,"player:faction") then
return outputChatBox("Nie mo?esz tego zrobi?!",plr,255,0,0)
end
a=(getElementData(plr,"antySpamzgloszenia") or 0)+60000
b=getTickCount()
if a>b then
return outputChatBox("Nie tak szybko! Poczekaj chwile z tymi zawiadomieniami (Poczekaj: "..math.floor((a-b)/1000).."s)",plr,255,0,0)
end
x,y,z=getElementPosition(plr)
miejsce=getZoneName(x,y,z)
dokladne=getZoneName(x,y,z,true)
exports["pystories-db"]:dbSet("insert into Zawiadomienia values(null,NOW(),?,?,?,?,?,0,0)",uid,getPlayerSerial(plr),miejsce,toJSON({x,y,z},true),"PSP")
for i,v in ipairs(getElementsByType("player")) do
if getElementData(v,"player:faction")=="PSP" then
outputChatBox(getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." wezwa? Stra? po?arn?, jed? do "..dokladne.." ("..miejsce..") (ID: "..tostring(id)..")", v,0,255,0)
triggerClientEvent(v,"ZAWIADOMIENIA:SAFD:pokaz",resourceRoot,x,y,z,id)
end
end
setElementData(plr,"antySpamzgloszenia",getTickCount())
outputChatBox("Wezwa?e? stra? po?arn?! Wkr?tce si? tu kto? pojawi!",plr,0,255,0)
end
addCommandHandler("998",strazpozarna)
function pogotowie(plr)
uid=getElementData(plr,'player:sid')
if not uid then return end
if getElementData(plr,"player:faction") then
return outputChatBox("Nie mo?esz tego zrobi?!",plr,255,0,0)
end
a=(getElementData(plr,"antySpamzgloszenia") or 0)+60000
b=getTickCount()
if a>b then
return outputChatBox("Nie tak szybko! Poczekaj chwile z tymi zawiadomieniami (Poczekaj: "..math.floor((a-b)/1000).."s)",plr,255,0,0)
end
x,y,z=getElementPosition(plr)
miejsce=getZoneName(x,y,z)
dokladne=getZoneName(x,y,z,true)
exports["pystories-db"]:dbSet("insert into Zawiadomienia values(null,NOW(),?,?,?,?,?,0,0)",uid,getPlayerSerial(plr),miejsce,toJSON({x,y,z},true),"PR")
for i,v in ipairs(getElementsByType("player")) do
if getElementData(v,"player:faction")=="PR" then
outputChatBox(getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." wezwa? Pogotowie, jed? do "..dokladne.." ("..miejsce..") (ID: "..tostring(id)..")", v,255,0,0)
triggerClientEvent(v,"ZAWIADOMIENIA:MDSA:pokaz",resourceRoot,x,y,z,id)
end
end
setElementData(plr,"antySpamzgloszenia",getTickCount())
outputChatBox("Wezwa?e? pogotowie! Wkr?tce si? tu kto? pojawi!",plr,0,255,0)
end
addCommandHandler("999",pogotowie)
function taxi(plr)
uid=getElementData(plr,'player:sid')
if not uid then return end
if getElementData(plr,"player:faction") then
return outputChatBox("Nie mo?esz tego zrobi?!",plr,255,0,0)
end
a=(getElementData(plr,"antySpamzgloszenia") or 0)+60000
b=getTickCount()
if a>b then
return outputChatBox("Nie tak szybko! Poczekaj chwile z tymi zawiadomieniami (Poczekaj: "..math.floor((a-b)/1000).."s)",plr,255,0,0)
end
x,y,z=getElementPosition(plr)
miejsce=getZoneName(x,y,z)
dokladne=getZoneName(x,y,z,true)
exports["pystories-db"]:dbSet("insert into Zawiadomienia values(null,NOW(),?,?,?,?,?,0,0)",uid,getPlayerSerial(plr),miejsce,toJSON({x,y,z},true),"TAXI")
for i,v in ipairs(getElementsByType("player")) do
if getElementData(v,"player:faction")=="TAXI" then
outputChatBox(getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." wezwa? taxi, jed? do "..dokladne.." ("..miejsce..") (ID: "..tostring(id)..")", v,255,0,0)
triggerClientEvent(v,"ZAWIADOMIENIA:MDSA:pokaz",resourceRoot,x,y,z,id)
end
end
setElementData(plr,"antySpamzgloszenia",getTickCount())
outputChatBox("Wezwa?e? taxi! Wkr?tce si? tu kto? pojawi!",plr,0,255,0)
end
addCommandHandler("taxi",taxi)
iloscKasy={
["KGP"]=300000,
["PSP"]=300000,
["PR"]=300000,
["TAXI"]=300000,
["PD"]=300000,
}
function odebranoZawiadomienie(id)
co=getElementData(client,"player:faction")
ilosckasy=iloscKasy[co]
givePlayerMoney(client,ilosckasy)
outputChatBox("Otrzyma?e? "..ilosckasy.."pln a odebranie zg?oszenia!",client,0,255,0)
uid=getElementData(client,'player:sid')
exports["pystories-db"]:dbSet("update Zawiadomienia set odebral=?,odebral_data=now() where ID=?",uid,id)
x,y,z=getElementPosition(client)
miejsce=getZoneName(x,y,z)
dokladne=getZoneName(x,y,z,true)
tekst=getPlayerName(client):gsub("#%x%x%x%x%x%x","").." dojecha? na miejsce ( "..dokladne..", "..miejsce.." ) zg?oszenia ID: "..id
for i,v in ipairs(getElementsByType("player")) do
if getElementData(v,"player:faction")==co then
outputChatBox(tekst,v,0,255,0)
triggerClientEvent(v,"ZAWIADOMIENIA:SAPD:usun",resourceRoot,id)
end
end
end
addEvent("ZAWIADOMIENIA:Odebrane",true)
addEventHandler("ZAWIADOMIENIA:Odebrane",resourceRoot,odebranoZawiadomienie)