Witam Chc? zrobi? export do bazy danych tak aby po wjechaniu w punkt na pracy dostawalo si? hajs do bankomatu nie do hudu
[lua]function busDriver(el, md)
if el ~= localPlayer or not md then return end
if jobTarget > maxTarget and getPedOccupiedVehicle(el) then return end
if jobTarget == maxTarget and not getPedOccupiedVehicle(el) then return end
if jobTarget == #districtsBus then
finishJob()
playSoundFrontEnd(5)
addEventHandler("onClientRender",root,render3)
setTimer(renderstop3,2000,1)
--outputChatBox("* Zako�czy�e�/a� prac�.")
else
kasa = math.random(75,150)
showMarker()
playSoundFrontEnd(12)
if getElementData(el,"player:premium") then
addEventHandler("onClientRender",root,render4)
setTimer(renderstop4,1000,1)
--outputChatBox("* Zidentyfikowa?e?(a?) punkt i otrzymujesz 100 PLN.")
local id = getElementData(el, "player:sid")
exports["pystories-db"]:dbSet("UPDATE pystories_users SET bank_money=bank_money+15000 WHERE id=?", id)
setElementData(el,"player:srp", getElementData(el,"player:srp")+math.random(0,1))
else
--outputChatBox("* Zidentyfikowa?e?(a?) punkt i otrzymujesz 75 PLN.")
addEventHandler("onClientRender",root,render4)
...
Witam ot?? pr?bowa?em doda? do panelu logowania dawanie premki gdy dany gracz si? zarejestruje lecz nie wychodzi?o mi to.
element data na premke
[lua]setElementData("player:premium", 7)[/lua]
t? 7 doda?em bo chc? by dawa?o na 7dni.
kod s_logowanie
[lua]
--[[
--[[
Panel Logowania by Kurianusz @2016 .
Regulamin /Licencja
Korzystanie z tego kodu tylko je?eli posiadasz tzw. copyrights. Zakaz usuwania tej notatki!
Pami?taj ?e nielegalne korzystanie z kodu podpada pod kodeks karny :> Tak samo jak usuni?cie tej notatki!
]]
function sprawdzorganizacje(plr)
local x = exports['ogrpg-db']:dbGet("SELECT spawn from ogrpg_organization_list join ogrpg_organizations on ogrpg_organizations.code = ogrpg_organization_list.id WHERE uid=? and not(spawn=?)",getElementData(plr,"player:uid"),"0,0,0")
if x and #x > 0 then
local t = split(x[1].spawn, ",")
return t
end
return false
end
function getAdmin(plr,level)
if level then
local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=? AND level=?", getPlayerSerial(plr), level)
if result and #result > 0 then
return true
else
return false
end
else
local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=?", getPlayerSerial(plr))
if result and #result > 0 then
return true
else
return false
end
end
end
Chc? da? Admina przez mysql daje sobie dziala..
Daje komus nie dziala
Dodaje w kolumny wartosci klikam wstaw i niby jest ktos /duty i nie dziala sprawdzalem na sobie dwa razy i mi dzia?a a innym nie powie ktos o co chodzi?
Reconnecty byly robione.. licze na szybk? odpowiedz stawiam piwko
Witam mam problem gdy? chce zeby gracz jak wchodzil na serwer pierwszy raz to dostaje 2000 na start ale nie wiem jak to zrobic oto moj kod ktory nie dzia?a:
Server:
[center][b]Witam[/b]
Mam taki problem po zmianie zarobk?w chodzi o to ze jak uda?o mi si? zrobi? zarobki z prac do bankomat?w to nie dostaje reputacji.[/center]
trigger z pracy
[lua]triggerServerEvent("WyplataPraca",root, 10)[/lua]
a tu kod kt?ry powinien dawa? reputacje.
S:
[lua]addEvent("givePlayerMoney", true)
addEventHandler("givePlayerMoney", root, function(value,value2)
-- nie zalogowana osoba a fuj
if not tonumber(value) then return end
if not getElementData(source,"player:logged") then return end
givePlayerMoney(source,value*2)
local rnd={math.random(1,30),math.random(1,2)}
if rnd[1] == 1 or rnd[1] == 15 or rnd[1] == 26 then
local rep=getElementData(source,"player:reputation") or 0
local xd=rep+rnd[2]
setElementData(source,"player:reputation",xd)
triggerClientEvent(source, "reputation:show", resourceRoot, rnd)
end
end)
addEvent("takePlayerMoney", true)
addEventHandler("takePlayerMoney", root, function(how)
if not getElementData(source,"player:logged") then return end
if not tonumber(how) then return end
takePlayerMoney(source,how);
end)
-- Kod s?u??cy od usuwania danego pojazdu
addEvent("destroyVehicle", true)
addEventHandler("destroyVehicle", root, function(veh)
if not veh then return end
destroyElement(veh)
if obiekt[veh] then
destroyElement(obiekt[veh])
end
end)
Siemaneczko, mam pi?kny skrypt na pojazdy z salonu, ale mam 2 problemy, a mianowicie takie, ?e nie wiem do cholery jak zrobi?, aby dawa?o X Litr?w paliwa oraz kolejne ID pojazdu na rejestracji (Np. SF 1). Ma kto? jaki? pomys? jak to zrobi?? Dam repk? oraz zimne piwko!
Witam. Mam problem z dawaniem skina po zalogowaniu. Ot??, jak wybior? spawn to daje mi skina CJ. Mo?e to kto? poprawi??
S-Side z logowania:
[lua]function PlayerLogin(username,password,checksave)
if not (username == "") then
if not (password == "") then
local account = getAccount ( username,password )
if ( account ~= false ) then
logIn(source, account, password)
setCameraTarget(source, source)
outputChatBox ("Gratulacje! Zalogowa?e? si? poprawnie!", source)
triggerClientEvent (source,"Zacznij",getRootElement())
toggleControl (source, "fire", false)
toggleControl (source, "aim_weapon", false)
end
end
end
end
addEvent("onRequestLogin",true)
addEventHandler("onRequestLogin",getRootElement(),PlayerLogin)
function registerPlayer(username,password,passwordConfirm)
if not (username == "") then
if not (password == "") then
local account = getAccount (username,password)
if (account == false) then
local accountAdded = addAccount(tostring(username),tostring(password))
if (accountAdded) then
triggerClientEvent (source, "Zaloguj", root, source)
else
triggerClientEvent( source, "Konto_jest", root, source)
end
else
triggerClientEvent ( source, "Nick_Konto", root, source)
end
else
triggerClientEvent ...
Siema, tutaj ?ysy, ja z problemem:
Napisa?em skrypt z poradnika, i nie dzia?a .
Mogliby?cie pom?c? Oczywi?cie, daje Grza?ca, na ocieplenie .
Chcia?bym aby w kodzie znajdowa? si? w markerze text3d, z napisem: Darmowe Buffalo, ale nie wiem jak to zrobi? ;/.
KOD:
Pozdrawiam,
?ysy.
[ Dodano: 2014-12-27, 12:29 ]
Wydaje mi si?, ?e musz? dwa razy end da?, ale nie jestem pewien.
Witam, mam problem gdy? chce zapisa? lidera do MySQL ale si? co? nie zapisuje. Gdy daje lidera to dzia?a dobrze, ale lidera nie zapisuje.
Za pomoc dzi?kuje, ka?d? wypowied? nagradzam .
Hejo. Mam problem z komend?.. a raczej zupe?nie nie wiem jak j? zrobi?.
Chce zrobi? dawanie/usuwanie przez komend? HeadAdmina w mysql.
Mam zmienn?
i chce najlepiej aby w tabeli "Players" robi?o kolejn? linijke HeadAdmin i tam by mo?na by?o zmienia? z 1 na 0 lub na odwr?t.. Wiadomo chyba o co chodzi? ?e jak dam HeadAdmina graczu o nick'u