Siemka, napisa?em kiedy? prosty skrypt na zabieranie broni pod OGRPG.
autor: herculeS - hrls - JA kiedy? rudzik
Notka jest stara wi?c prosz? si? nie ?mia? co tam pisa?em. Poprostu b?d? cz?owiekiem i nie usuwaj notki lub nie podszywaj si? pod autora
IMG: Prosty skrypt kt?rego nie trzeba prezentowa? policja poprostu pisze /zabierz id gracza i zabiera wszystkie bronie jakie gracz posiada.
Aby przerobi? to pod nazw? gracza export z ogrpg core trzeba zamieni? na
Witam, chcia?bym zrobi? lecz nie wiem jak. Aby zabiera?o t? elementdate nie po restarcie skryptu tylko np co 5 sek, bez daremnego restartu skryptu jak to zrobi? ?
c_side
Witam nie dziala mi zabieranie prawka niby w bazie sie zapisuje ale nadal mozna wsiadac do auta pystories-core i pystories-admin dodane do acl
tabela bazy sql
[quote]
--
-- Struktura tabeli dla tabeli `pystories_punish`
--
CREATE TABLE `pystories_punish` (
`kolejnosc` int(11) NOT NULL,
`serial` text NOT NULL,
`reason` text CHARACTER SET utf8 NOT NULL,
`time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`type` text NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1; [/quote]
funckja zpj
[quote]
addCommandHandler("zpj", function(plr,cmd,cel,time,type,...)
if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) or getAdmin(plr,4) or getAdmin(plr,5) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(time) or not type or not reason then
outputChatBox("#ff0000✘ #ffffff- /zpj <ID> <czas> <m/h/y/w> <pow?d>", plr, 255, 252, 51,true)
return
end
local target=exports["pystories-core"]:findPlayer(plr,cel)
if not target then
outputChatBox("#ff0000✘ #ffffff- Nie znaleziono podanego gracza.", plr, 255, 252, 51,true)
return
end
if isPedInVehicle(target) then
removePedFromVehicle(target)
end
--if getElementData(target,"player:sid") == 2 then outputChatBox("* Nie mo?na zabra? prawo jazdy graczowi o SID: 1 !",plr) return end
...
Kod
[lua]function getVehicleKey(plr,veh)
if plr and veh then
local uid=getElementData(plr,"player:uid")
if not uid then return end
if getElementData(plr,"player:admin") or uid == getElementData(veh,"vehicle:ownedPlayer") then
return true
else
return false
end
end
end
local categoryL={[592] = true,[553] = true,[577] = true,[488] = true,[511] = true,[497] = true,[548] = true,[563] = true,[512] = true,[476] = true,[593] = true,[447] = true,[425] = true,[519] = true,[520] = true,[460] = true,[417] = true,[469] = true,[487] = true,[513] = true}
addEventHandler("onVehicleStartEnter", root, function(plr,seat,jacked)
if getElementHealth(source) < 302 then
setElementHealth(source,302)
end
end)
function jestwtabeli(***,truj)
for k,v in pairs(***) do
if v == truj then
return true
end
end
return false
end
addCommandHandler("share",function(plr,cmd,target)
local veh = getPedOccupiedVehicle(plr)
if not veh then outputChatBox("#bf0101(✖) #FFFFFFNie siedzisz w aucie!",plr,255,255,255, true) return end
if getElementData(veh,"vehicle:ownedPlayer") ~= getElementData(plr,"player:uid") then outputChatBox("* Ten pojazd nie nale?y od ciebie!",plr...
Nie dzia?a zabieranie prawo jazdy na GM pys 3.0
doda?em do Admin'a w resources Pystories-admin, Pystories-dutyadmin, duty admin i tym podobne no i oczywiscie na pocz?tku dalem resource.
Witam ot?? pomo?e mi kto?, bo chce ?e jak wyjdziemy z strefy DM zabierze nam bro?, pom?g?by kto?>?
kod
[lua]local area=createRadarArea(-123.19,1653.11, 520, 450, 450, 0, 0, 40)
--2918.59,-896.90
setRadarAreaFlashing(area, true)
local strefa = createColRectangle(-123.19,1653.11, 520, 450)
addEventHandler("onColShapeHit", resourceRoot,
function(plr,dim)
if (getElementType(plr) == "player") then
if dim then
if getElementDimension(plr)==0 then
if getElementInterior(plr) == 0 then
setElementData(plr, "strefadm", true)
exports["es-komunikaty"]:komunikat("Wchodzisz do strefy DM.", plr)
if getElementData(plr, "kajdanki") or getElementData(plr, "delikwent") then
return
end
if not isControlEnabled(plr, "enter_exit") and isPedInVehicle(plr) then
return
end
toggleControl(plr, "fire", true)
toggleControl(plr, "aim_weapon", true)
end
end
end
end
end
)
addEventHandler("onColShapeLeave", resourceRoot,
function(plr,dim)
if (getElementType(plr) == "player") then
if dim then
if getElementData(plr,"Policja:sluzba") then
setElementData(plr, "strefadm&qu...
Witam, od czego zacz?? kod tak, aby stopniowo zabiera? hp co sekund? o 0.009 jednostek graczowi od czasu wej?cia do gry? Robie to ju? 2 godziny i nie chce dzia?ac, a nie mam pomys?u na rozkmine Za pomoc piwka i rep
Siema, mam serwer MTA i jak dodac zeby bronie mogly zabierac HP? Bo jest organizacja taka i bronie nie zabieraja hp jak zrobic zeby zabieraly ale tylko bronie.
Witam ot?? chcia?bym aby zabiera?o pieni?dze nie z konta gracza lecz, z banku. Bazuje na GM ogrpg.
Kod jest na salony, chcia?ym jak ju? pisa?em by po kupnie pojazdu zabiera?o hajs z bankomatu a nie z ekwipunku.
kod
[lua]--BLIP CYGANA
createBlip(1011.35, -1355.06, 13.35, 16,2,0,0,0,0,0,275)
--salon
createBlip(1250.35, -1651.25, 12.67, 55,2,0,0,0,0,0,275)
--salon drogi
createBlip(973.90, -1470.15, 19.20, 55,2,0,0,0,0,0,275)
--mech
createBlip(1021.82, -1469.92, 13.55, 27,2,0,0,0,0,0,275)
--posX="1443.9" posY="-1578.6" posZ="13.6"
--posX="1965.3" posY="2169.7" posZ="9.5"
Siemka nie dzia?a mi ban,kick, zabieranie loicki i prawka jak daje bana nie wywala gracza z serwera i go nie banuje z kickiem tak samo nie wywala typa z serwa oczywi?cie wszystko wyskakuje u g?ry ?e gracz zosta? wyrzucony z serwera itp albo ?e zosta? zbanowany.a z lick? i prawkiem jest ?e dam prawko a gracz mo?e spowrotem wej?? do auta
na banie i kicku wyskakuje ?e gracz zostaa? wyrzucony z serwera z powodu animki.Lecz nie wyrzuca go z serwera tak samo jest z bane wyskakuje ?e gracz zosta? zbanowany ale ca?y czas jest na serwie.
Z licka i prawkiem jest tak samo gracza wyrzuca z pojazdu ale mo?e do niego wej?? co mam robic pomocy.
Witam zabieranei prawka mi nie dziala tutaj podaje kod
[lua]ddCommandHandler("zpj", function(plr,cmd,cel,time,rodzaj,...)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(time) or not rodzaj or not reason then
outputChatBox("* U?ycie: /zpj <nick/ID> <czas> <jednostka: m/h/d/w> <pow?d>", plr)
return
end
local target=exports["ogrpg-core"]:findPlayer(plr,cel)
if not target then
outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
return
end
local query=string.format("SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","prawko", getPlayerSerial(target))
local result=exports["ogrpg-db"]:pobierzWyniki(query)
if (result) then
return outputChatBox(" Gracz Posiada zawieszone prawo jazdy do "..result["time"]..", za: "..result["reason"], plr, 255, 0, 0)
else
exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?", "prawko", getPlayerSerial(plr))
end
if isPedInVehicle(target) then
removePedFromVehicle(target)
end
if tonumber(time) <= 0 then return end
reason = reason.." |od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").....
Mam taki ma?y problem mam skrypty na zabieranie prawka po??czone z mysql
Problem le?y w 2 rzeczach 1. Gdy jestem "nowym" graczem moge odrazu do wszystkiego wsiada?.Problem 2 to jest ?e gdy mam zawieszony prawa jazdy nadal moge wsiadac a w db 3 nic nie pisze o bledzie
Daje wam linijki Kod?w oraz ss myqsl
Komenda admina na zabierania Prawka
[lua]
addCommandHandler("zpj", function(plr,cmd,cel,time,type,...)
if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then
local reason=table.concat({...}, " ")
if not cel or not tonumber(time) or not type or not reason then
outputChatBox("* U??ycie: /zpj <nick/ID> <czas> <jednostka: m/h/y/w> <pow?d>", plr)
return
end
local target=exports["ogrpg-core"]:findPlayer(plr,cel)
if not target then
outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
return
end
if isPedInVehicle(target) then
removePedFromVehicle(target)
end
result=pobierzDate(type,time)
triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(target).."("..getElementData(target,"id")..") otrzyma?/a zakaz prowadzenia pojazd?w kat(ABC) od "..getPlayerName(plr)..": "..reason.."("..time .. type ..")")
exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,?,?)", getPlayerSeri...
Mam problem, nie wiem od czego zacz?? w zabieraniu prawka na czas.
Mam kod z zabieraniem na zawsze - i on dzia?a.
Natomiast je?li chodzi o czas, to funkcja setTimer? Czy getTickCount?
[lua]function zabieranie(player,cmd,account,kate)
local account = getPlayerAccount(source)
if getPlayerTeam(player) == getTeamFromName("Policja") then
setAccountData(account, "kat"..kate, false)
else
outputChatBox("Nie jeste? z polcji",player,255,255,255,true)
end
end
addCommandHandler("zab.prawo",zabieranie)[/lua]
ale np to dzia?a
[lua]function sprawdzPrawoJazdy(player, cmd, gracz)
if getPlayerTeam(player) == getTeamFromName("Policja") then
if gracz then
local gracz = getPlayerFromName(gracz)
if gracz then
local account = getPlayerAccount(gracz)
if account then
outputChatBox("Wybrany gracz: "..getPlayerName(gracz)..".", player, 240, 240, 240, true)
local a = getAccountData(account, "katA")
if a == true then
ka = "Tak"
else
ka = "Nie"
end
local b = getAccountData(account, "katB")
if b == true then
kb = "Tak"
else
kb = "Nie"
end
local c = getAccountData(account, "katC")
if c == true then
kc = "Tak"
else
kc = "Nie"
end
outputChatBox("Kategoria A: "..ka..".", player, 230, 230, 230, true)
outputChatBox("Kategoria B: "..kb..".", player, 230, 230, 230, true)
outputChatBox("Kategoria C: &qu...
Witam. Dzi? zobaczy?em ?e komend? jak? mam na zabierania prawka nie dzia?a. Ale w jakim sensie?
Chodzi o to gdy wpisze /prawko (tutaj nick np.) tester to na chacie ujawnia si? informacja ?e:
ReseT_ traci prawo do jazdy przez tester, powodem: test.
a powinno by?:
tester traci prawo do jazdy przez ReseT_, powodem: test.
Kod strona serwera:
[lua]
addCommandHandler("prawko", function(plr, cmd, cel, ...)
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(plr)), aclGetGroup("Administrator")) then
local target = findPlayer(plr, cel)
if (not target) then
outputChatBox("Nie znaleziono takiego gracza online!", getRootElement(), 253, 0, 0)
return
end
local tresc = table.concat(arg, " ")
local pojazd = getPedOccupiedVehicle(target)
if (string.len(tresc)<=1) then
outputChatBox("Nie podano powodu zabrania prawa do jazdy. Wpisz ponownie /prawko [nick] [pow?d].", getRootElement(), 253, 0, 0)
return
end
if (getPedOccupiedVehicle(target)) then
removePedFromVehicle(target)
end
local konto = getPlayerAccount(plr)
setAccountData(konto, "prawojazdy", false)
outputChatBox(getPlayerName(plr) .." traci prawo do jazdy przez " .. getPlayerName(target) .. ", powodem: " .....
Cze??, robie komende na zabieranie prawka lecz mam pewien problem..
Kod:
[lua]addCommandHandler("zabierz.prawko", function(plr,cmd,cel,...)
if onCheckAdmin(plr,1) or onCheckAdmin(plr,2) or onCheckAdmin(plr,3) then
local reason=table.concat({...}, " ")
if not cel or not reason then
outputChatBox("* U?ycie: /zabierz.prawko <nick/ID> <pow?d>", plr)
return
end
local target=exports["og-core"]:findPlayer(plr,cel)
local target2=getPlayerName(target)
if not target then
outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
return
end
if isPedInVehicle(target) then
removePedFromVehicle(target)
end
outputChatBox("Gracz "..getPlayerName(target).." otrzyma?/a zakaz prowadzenia pojazd?w od "..getPlayerName(plr).." za "..reason.."")
outputChatBox("Prawo jazdy mo?esz zda? na nowo w urz?dzie",target)
exports["og-db"]:setRekord("UPDATE 'og_users' SET 'pjC' = 0 WHERE 'login' = '"..target2.."'")
exports["og-db"]:setRekord("UPDATE 'og_users' SET 'pjB' = 0 WHERE 'login' = '"..target2.."'")
exports["og-db"]:setRekord("UPDATE 'og_users' SET 'pjA' = 0 WHERE 'login' = '"..target2.."'")
end
end)[/lua]
DB3:
[code]
dbExec failed; (1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL s...
Witajcie, mam problem ze skryptem, a mianowicie z mechanikiem. Wszystko dzia?a po wjechaniu w marker fixa nam auto lecz nie wiem jak zrobi? aby zabiera?o graczowi pieni?dze. Mo?e kto? wie? za pomoc
Witam, chc? aby po wyj?ciu z wody w skinie 97 po 5 sekundach gdy nie wejdziemy spowrotem do wody zabiera nam skina oraz pasek tlenu. Po zabraniu skina przywraca nam tego co mieli?my.
local playerData = { skinGracza = source.model }
local pasekTlenu = {"breath"}
addEventHandler("onResourceStart", resourceRoot,
function(localPlayer) setTimer(function(localPlayer) local Skin = tonumber(getElementModel(localPlayer))
if ((not Skin) or (Skin ~= 97)) then return end if isElementInWater(localPlayer) then else setElementModel(playerData.skinGracza, 0, 0) setPlayerHudComponentVisible(pasekTlenu, false) end
end, 5000, 0) end )
Error: attempt to index global 'source' <a nil value> Jest to: skinGracza = source.model
Witam.Mam pewien problem z zabraniem rangi.Mianowicie gdy gracz zaloguje si? na rang?,wyjdzie z serwera to kolejny gracz kt?ry wejdzie posiada ta rang?.Jak zrobi? by po wyj?ciu z serwera temu graczu usuwa?a si? ranga ?Oto komenda jaka jest do logowania: