Wysłany: 2019-02-21, 11:00
EinfachFischi
Wiek: 23 Na forum: 2744 dni Posty: 9
Nick w MP: Damianek
Witam mam problem z komendami one po prostu nie dzialaja. prosze o pomoc
addCommandHandler ( "ucho" , function( plr , cmd )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
local x = getElementData ( plr , "player:ucho" )
setElementData ( plr , "player:ucho" , not x )
end
end )
addCommandHandler ( "daj.ogp" , function( plr , cmd , cel , value )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 4 ) then
if not cel or not tonumber ( value ) then
outputChatBox ( "* U?ycie: /daj.ogp <nick/ID> <ilosc>" , 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
setElementData ( target , "player:reputation" , getElementData ( target , "player:reputation" )+ value )
outputChatBox ( "* Otrzyma?e?(a?) " .. value .. " Reputacji!" , target )
end
end )
addCommandHandler ( "tune" , function( plr , cmd , cel , value )
if getAdmin ( plr , 5 ) or getAdmin ( plr , 6 ) then
if not cel or not tonumber ( value ) then
outputChatBox ( "* U?ycie: /tune <nick/ID> <id>" , 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 veh = getPedOccupiedVehicle ( target )
addVehicleUpgrade ( veh , value )
outputChatBox ( "* Do twojego pojazdu dodano tuning, o id: " .. value .. "" , target )
outputChatBox ( "* Doda?e? tuning ID " .. value .. " do pojazdu gracza " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ), plr )
end
end )
addCommandHandler ( "turbo" , function( plr , cmd , cel , value )
if getAdmin ( plr , 5 ) or getAdmin ( plr , 6 ) then
local pojazd = getPedOccupiedVehicle ( plr )
outputChatBox ( "* Zamontowa?e?(a?) uk?ad Turbo." , plr )
setVehicleHandling ( pojazd , "engineAcceleration" , getVehicleHandling ( pojazd ). engineAcceleration + 4 )
setVehicleHandling ( pojazd , "maxVelocity" , getVehicleHandling ( pojazd ). maxVelocity + 35 )
setVehicleHandling ( pojazd , "tractionMultiplier" , 0.8 )
setVehicleHandling ( pojazd , "steeringLock" , 50 )
setVehicleHandling ( pojazd , "driveType" , "awd" )
end
end )
addCommandHandler ( "kolor" , function( plr , cmd , cel , value , value2 , value3 )
if getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 4 ) then
if not cel or not tonumber ( value ) or not tonumber ( value2 ) or not tonumber ( value3 ) then
outputChatBox ( "* U?ycie: /kolor <nick/ID> <r g b>" , 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 veh = getPedOccupiedVehicle ( target )
setVehicleColor ( veh , value , value2 , value3 , value , value2 , value3 )
outputChatBox ( "* Twojemy pojazdu zmieniono kolor." , target )
outputChatBox ( "* Zmieni?e? kolor pojazdu graczu: " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ), plr )
end
end )
addCommandHandler ( "przeb" , function( plr , cmd , cel , value , value2 , value3 )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 4 ) then
if not cel or not tonumber ( value ) then
outputChatBox ( "* U?ycie: /przeb <nick/ID> <km>" , 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 veh = getPedOccupiedVehicle ( target )
setElementData ( veh , "vehicle:mileage" , value )
outputChatBox ( "* Twojemy pojazdu zmieniono przebieg." , target )
outputChatBox ( "* Zmieni?e? przebieg pojazdu graczu: " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ), plr )
end
end )
addCommandHandler ( "name" , function( plr , cmd , cel , value )
if getAdmin ( plr , 6 ) then
if not cel or not value then
outputChatBox ( "* U?ycie: /name <nick/ID> <name>" , 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
setPlayerName ( target , value )
outputChatBox ( "* Administrator " .. getPlayerName ( plr ) .. " zmieni?(a) ci nick na: " .. value .. "" , target )
outputChatBox ( "* Zmieni?e? graczu ID (" .. getElementData ( target , "id" ).. ") nick na: " .. value .. "" , plr )
end
end )
-- Komendy admin ? w
addCommandHandler ( "jp" , function( plr , cmd )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if isPedInVehicle ( plr ) then
removePedFromVehicle ( plr )
end
if doesPedHaveJetPack ( plr ) then
removePedJetPack ( plr )
else
givePedJetPack ( plr )
end
end
end )
addCommandHandler ( "k" , function( plr , cmd , cel ,...)
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 reason then
outputChatBox ( "* U?ycie: /k <nick/ID> <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
triggerClientEvent ( root , "admin:rendering" , root , "* " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( target , "id" ).. ") zosta?(a) wyrzucony(a) przez " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. ": " .. reason .. "" )
kickPlayer ( target , plr , reason )
end
end )
addCommandHandler ( "kick" , function( plr , cmd , cel ,...)
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
local reason = table . concat ({...}, " " )
if not cel or not reason then
outputChatBox ( "* U?ycie: /kick <nick/ID> <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
triggerClientEvent ( root , "admin:rendering" , root , "* " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( target , "id" ).. ") zosta?(a) wyrzucony(a) przez " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. ": " .. reason .. "" )
kickPlayer ( target , plr , reason )
end
end )
addCommandHandler ( "prezent" , function( plr , cmd , money )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) then
if ( not money ) then
outputChatBox ( "U?yj: /prezent <hajsy>" , plr )
return end
if not tonumber ( money ) then
outputChatBox ( "* /prezent <hahsy>" , plr )
return end
money = tonumber ( money )
if money <= 0 then
outputChatBox ( "* Za mala odleglosc" , plr )
return end
if money > 10000 then
outputChatBox ( "* Za duza odleglosc maks 10k" , plr )
return end
takePlayerMoney ( plr , money )
local x , y , z = getElementPosition ( plr )
local cub = createMarker ( x , y + 2 , z , "corona" , 1 , 255 , 120 , 255 , 155 )
local t = createElement ( "text" )
setElementPosition ( t , x , y + 2 , z )
setElementData ( t , "name" , "Prezent :)" )
addEventHandler ( "onMarkerHit" , cub , function( el , md )
if getElementType ( el ) == "player" then
outputChatBox ( "*Gracz " .. getPlayerName ( el ).. " zgarnia prezent o wartosci " .. money .. "PLN!" , root , 255 , 0 , 0 )
givePlayerMoney ( el , money )
destroyElement ( source )
destroyElement ( t )
end
end )
setTimer (function() if isElement ( cub ) then destroyElement ( cub ); destroyElement ( t ) end end , 15000 , 1 )
end
end )
addCommandHandler ( "tt" , function( plr , cmd , cel )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if not cel then
outputChatBox ( "* U?ycie: /tt <nick/ID>" , 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 ( plr ) then
removePedFromVehicle ( plr )
end
local x , y , z = getElementPosition ( target )
setElementInterior ( plr , getElementInterior ( target ))
setElementDimension ( plr , getElementDimension ( target ))
setElementPosition ( plr , x + math . random ( 1 , 2 ), y + math . random ( 1 , 2 ), z )
end
end )
addCommandHandler ( "th" , function( plr , cmd , cel )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if not cel then
outputChatBox ( "* U?ycie: /th <nick/ID>" , 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
local x , y , z = getElementPosition ( plr )
setElementInterior ( target , getElementInterior ( plr ))
setElementDimension ( target , getElementDimension ( plr ))
setElementPosition ( target , x + math . random ( 1 , 2 ), y + math . random ( 1 , 2 ), z )
end
end )
addCommandHandler ( "warn" , function( plr , cmd , cel ,...)
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
local reason = table . concat ({...}, " " )
if not cel or not reason then
outputChatBox ( "* U?ycie: /warn <nick/ID> <powod>" , 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
outputChatBox ( "******************************" , target , 255 , 0 , 0 )
outputChatBox ( "* Otrzyma?e?(a?) ostrze?enie..." , target , 255 , 0 , 0 )
outputChatBox ( "* Nie stosowanie si? do ostrze?e?," , target , 255 , 0 , 0 )
outputChatBox ( "* Mo?e skutkowa? kicki'em lub ban'em." , target , 255 , 0 , 0 )
outputChatBox ( "*****************************" , target , 255 , 0 , 0 )
outputChatBox ( "Pow?d: " .. reason , target , 255 , 0 , 0 )
triggerClientEvent ( root , "admin:rendering" , root , "* " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( target , "id" ).. ") otrzyma?(a) ostrze?enie od " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. ": " .. reason .. "" )
end
end )
addCommandHandler ( "zpj" , function( plr , cmd , cel , time , type ,...)
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 type 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
result = pobierzDate ( type , time )
reason = reason .. " |od " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. "|"
triggerClientEvent ( root , "admin:rendering" , root , "* " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( target , "id" ).. ") otrzyma?(a) zakaz prowadzenia pojazd?w kat(ABC) " .. reason .. "(" .. time .. type .. ")" )
exports [ "ogrpg-db" ]: dbSet ( "INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,?,?)" , getPlayerSerial ( target ), reason , result , "prawko" )
-- outputChatBox ( "* Dodanych rekord" , plr )
end
end )
addCommandHandler ( "zpl" , 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: /zpl <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
local query = string . format ( "SELECT * FROM ogrpg_punish WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "L" , 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=?" , "L" , getPlayerSerial ( plr ))
end
if isPedInVehicle ( target ) then
removePedFromVehicle ( target )
end
result = pobierzDate ( type , time )
reason = reason .. " |od " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. "|"
triggerClientEvent ( root , "admin:rendering" , root , "* " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( target , "id" ).. ") otrzyma?(a) zakaz prowadzenia pojazd?w lotniczych(L) " .. reason .. "(" .. time .. type .. ")" )
exports [ "ogrpg-db" ]: dbSet ( "INSERT INTO ogrpg_punish (serial,reason,time,type) VALUES (?,?,?,?)" , getPlayerSerial ( target ), reason , result , "L" )
-- outputChatBox ( "* Dodanych rekord" , plr )
end
end )
addCommandHandler ( "opj" , function( plr , cmd , cel )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if not cel then
outputChatBox ( "* U?ycie: /opj <nick/ID> " , 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
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "prawko" , getPlayerSerial ( target ))
outputChatBox ( "* Gracz " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. " odzyskal swoje prawo jazdy!" , plr , 0 , 255 , 0 )
outputChatBox ( "* " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. " oddal Twoje prawo jazdy!" , target , 0 , 255 , 0 )
else
outputChatBox ( "* Gracz " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. " nie posiada zabranego prawka!" , plr , 0 , 255 , 0 )
end
end
end )
addCommandHandler ( "opl" , function( plr , cmd , cel )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if not cel then
outputChatBox ( "* U?ycie: /opl <nick/ID> " , 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" , "L" , getPlayerSerial ( target ))
local result = exports [ "ogrpg-db" ]: pobierzWyniki ( query )
if ( result ) then
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_punish WHERE type=? AND active=1 AND serial=?" , "L" , getPlayerSerial ( target ))
outputChatBox ( "* Gracz " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. " odzyskal swoja Licencje!" , plr , 0 , 255 , 0 )
outputChatBox ( "* " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. " oddal Twoja Licencje!" , target , 0 , 255 , 0 )
else
outputChatBox ( "* Gracz " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. " nie posiada zabranej Licencji!" , plr , 0 , 255 , 0 )
end
end
end )
addCommandHandler ( "b" , function( plr , cmd , cel , time , type ,...)
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) then
local reason = table . concat ({...}, " " )
if not cel or not tonumber ( time ) or not type or not reason then
outputChatBox ( "* U?ycie: /b <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
if ( getAdmin ( plr , 3 ) == false ) and getAdmin ( target , 3 ) then outputChatBox ( "Nie mozesz tego zrobic na rconie!" , plr , 255 , 0 , 0 ) return end
local query = string . format ( "SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "ban" , getPlayerSerial ( target ))
local result = exports [ "ogrpg-db" ]: pobierzWyniki ( query )
if ( result ) then
return outputChatBox ( " Gracz Posiada Bana do " .. result [ "time" ].. ", za: " .. result [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?" , "ban" , getPlayerSerial ( target ))
end
result = pobierzDate ( type , time )
reason = reason .. " |od " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. "|"
if not result then outputChatBox ( "*Wpisales zla date **" , plr , 255 , 0 , 0 ) return end
triggerClientEvent ( root , "admin:rendering" , root , "* " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( target , "id" ).. ") otrzyma?(a) bana. Pow?d:" .. reason .. "(" .. time .. type .. ")" )
exports [ "ogrpg-db" ]: dbSet ( "INSERT INTO ogrpg_ban (serial,reason,time,type) VALUES (?,?,?,?)" , getPlayerSerial ( target ), reason , result , "ban" )
kickPlayer ( target , reason )
-- outputChatBox ( "* Dodanych rekord" , plr )
end
end )
addCommandHandler ( "pban" , function( plr , cmd , cel ,...)
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) then
local reason = table . concat ({...}, " " )
if not cel or not reason then
outputChatBox ( "* U?ycie: /pban <nick/ID> <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 ( getAdmin ( plr , 3 ) == false ) and getAdmin ( target , 3 ) then outputChatBox ( "Nie mozesz tego zrobic na rconie!" , plr , 255 , 0 , 0 ) return end
local query = string . format ( "SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "ban" , getPlayerSerial ( target ))
local result = exports [ "ogrpg-db" ]: pobierzWyniki ( query )
if ( result ) then
return outputChatBox ( " Gracz Posiada Bana do " .. result [ "time" ].. ", za: " .. result [ "reason" ], plr , 255 , 0 , 0 )
else
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?" , "ban" , getPlayerSerial ( target ))
end
reason = reason .. " |od " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. "|"
triggerClientEvent ( root , "admin:rendering" , root , "* " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( target , "id" ).. ") otrzyma?(a) bana " .. reason .. "(Na zawsze!)" )
exports [ "ogrpg-db" ]: dbSet ( "INSERT INTO ogrpg_ban (serial,reason,time,type) VALUES (?,?,?,?)" , getPlayerSerial ( target ), reason , "2030-12-31 23:59:59" , "ban" )
kickPlayer ( target , reason )
-- outputChatBox ( "* Dodanych rekord" , plr )
end
end )
addCommandHandler ( "unban" , function( plr , cmd , cel )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) then
if not cel then
outputChatBox ( "* U?ycie: /unban <serial> " , plr )
return
end
-- if string . len ( cel ) ~= 32 then return outputChatBox ( "* B??dny serial " , plr ) end
local query = string . format ( "SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1" , "ban" , cel )
local result = exports [ "ogrpg-db" ]: pobierzWyniki ( query )
if ( result ) then
exports [ "ogrpg-db" ]: dbSet ( "DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?" , "ban" , cel )
outputChatBox ( "* Usunieto bana o serialu (" .. cel .. ")!" , plr , 0 , 255 , 0 )
else
outputChatBox ( "* Nie wykryto bana o serialu (" .. cel .. ")!" , plr , 0 , 255 , 0 )
end
end
end )
addCommandHandler ( "fix" , function( plr , cmd )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
local veh = getPedOccupiedVehicle ( plr )
if not veh then
outputChatBox ( "* Nie znajdujesz si? w poje?dzie" , plr )
return
end
setElementHealth ( veh , 1000 )
fixVehicle ( veh )
end
end )
addCommandHandler ( "vtt" , function( plr , cmd , vid )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if not vid or not tonumber ( vid ) then return end
vid = tonumber ( vid )
for i , v in ipairs ( getElementsByType ( "vehicle" )) do
local dbid = getElementData ( v , "vehicle:id" )
if dbid and tonumber ( dbid ) == vid then
local x , y , z = getElementPosition ( v )
setElementPosition ( plr , x , y , z + 4 )
setElementInterior ( plr , getElementInterior ( v ))
setElementDimension ( plr , getElementDimension ( v ))
if getAdmin ( plr , 3 ) then
warpPedIntoVehicle ( plr , v )
end
return
end
end
local query = exports [ "ogrpg-db" ]: dbGet ( "SELECT 1 FROM ogrpg_vehicles WHERE id=? AND parking>0" , vid )
if query then
outputChatBox ( "* Pojazd znajduje sie na parkingu/w przechowalni." , plr , 255 , 0 , 0 )
else
outputChatBox ( "* Nie znaleziono podanego pojazdu na mapie." , plr , 255 , 0 , 0 )
end
end
end )
addCommandHandler ( "vth" , function( plr , cmd , vid )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if not vid or not tonumber ( vid ) then return end
vid = tonumber ( vid )
for i , v in ipairs ( getElementsByType ( "vehicle" )) do
local dbid = getElementData ( v , "vehicle:id" )
if dbid and tonumber ( dbid ) == vid then
if getElementData ( v , "vehicle:police_parking" ) then outputChatBox ( "*Auto jest na parkingu policyjnym!" , plr , 255 , 0 , 0 ) return end
local x , y , z = getElementPosition ( plr )
setElementPosition ( v , x , y , z + 0.1 )
setElementInterior ( v , getElementInterior ( plr ))
setElementDimension ( v , getElementDimension ( plr ))
if getAdmin ( plr , 3 ) then
warpPedIntoVehicle ( plr , v )
end
return
end
end
local query = exports [ "ogrpg-db" ]: dbGet ( "SELECT 1 FROM ogrpg_vehicles WHERE id=? AND parking>0" , vid )
if query then
outputChatBox ( "* Pojazd znajduje sie na parkingu/w przechowalni." , plr , 255 , 0 , 0 )
else
outputChatBox ( "* Nie znaleziono podanego pojazdu na mapie." , plr , 255 , 0 , 0 )
end
end
end )
addCommandHandler ( "heal" , function( plr , cmd , cel )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if not cel then
outputChatBox ( "Uzyj: /heal <id/nick>" , 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
setElementHealth ( target , 100 )
outputChatBox ( "* Uleczy?e?(a?) gracza " .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ), plr )
outputChatBox ( "* Zosta?e? uleczony(a) przez " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ), target )
end
end )
addCommandHandler ( "sserial" , function( plr , cmd , cel )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if not cel then
outputChatBox ( "Uzyj: /checkserial <id/nick>" , 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
outputChatBox ( "* Serial gracza(" .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "): " .. getPlayerSerial ( target ), plr )
end
end )
addCommandHandler ( "spec" , function( plr , cmd , cel )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if not cel then
outputChatBox ( "Uzyj: /spec <id/nick>" , 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 x , y , z = getElementPosition ( plr )
removePedFromVehicle ( plr )
setElementInterior ( plr , getElementInterior ( target ))
setElementDimension ( plr , getElementDimension ( target ))
setCameraTarget ( plr , target )
setElementData ( plr , "spec:pos" ,{ x , y , z })
end
end )
addCommandHandler ( "specoff" , function( plr , cmd )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
local spec = getElementData ( plr , "spec:pos" )
if not spec then return end
setElementPosition ( plr , spec [ 1 ], spec [ 2 ], spec [ 3 ])
setCameraTarget ( plr , plr )
end
end )
function destroyBlipsAttachedTo ( player )
local attached = getAttachedElements ( player )
if ( attached ) then
for k , element in ipairs ( attached ) do
if getElementType ( element ) == "blip" then
destroyElement ( element )
end
end
end
end
addCommandHandler ( "inv" , function( plr )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if getElementAlpha ( plr ) > 0 then
setElementAlpha ( plr , 0 )
destroyBlipsAttachedTo ( plr )
else
setElementAlpha ( plr , 255 )
local newValue = getElementData ( plr , "player:admin" ) -- find the new value
if newValue == true then
destroyBlipsAttachedTo ( plr )
createBlipAttachedTo ( plr , 0 , 2 , 255 , 255 , 255 )
else
destroyBlipsAttachedTo ( plr )
createBlipAttachedTo ( plr , 0 , 2 , 255 , 255 , 255 )
end
end
end
end )
addCommandHandler ( "invveh" , function( plr )
if getAdmin ( plr , 4 ) or getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
local plr = getPedOccupiedVehicle ( plr )
if not plr then return end
if getElementAlpha ( plr ) > 0 then
setElementAlpha ( plr , 0 )
else
setElementAlpha ( plr , 255 )
end
end
end )
Wysłany: 2019-02-21, 13:06
kondisz357
Wiek: 25 Na forum: 3052 dni Posty: 7
Nick w MP: discopolo
Da?e? skryptowi permisje admina resource.(nazwa skyptu np pystories-core)
Wysłany: 2019-02-21, 15:21
EinfachFischi
Wiek: 23 Na forum: 2744 dni Posty: 9
Nick w MP: Damianek
A.co zrobi? ?eby dzia?a?o?
Wysłany: 2019-02-21, 15:23
Gravgor
Wiek: 22 Na forum: 3619 dni Posty: 380
Nick w MP: 1944
Piwa : 702
Nadaj permisj? admina, jak napisali Ci powy?ej, powinno zadzia?a?. A je?li dalej nie b?dzie dzia?a?, sprawd? czy na pewno masz nadan? rang?.
Podpis
Portfolio marceliborowczak.me
Wysłany: 2019-02-21, 16:07
EinfachFischi
Wiek: 23 Na forum: 2744 dni Posty: 9
Nick w MP: Damianek
Czyli w ACL mam dopisa? w ADMIN resource.ogrpg-Core?
Wysłany: 2019-02-21, 17:19
Gravgor
Wiek: 22 Na forum: 3619 dni Posty: 380
Nick w MP: 1944
Piwa : 702
"EinfachFischi" napisał/a :Czyli w ACL mam dopisa? w ADMIN resource.ogrpg-Core?
Tak, spr?buj A, dodaj tak?e resource.dutyadmin
Podpis
Portfolio marceliborowczak.me
Wysłany: 2019-02-21, 20:57
EinfachFischi
Wiek: 23 Na forum: 2744 dni Posty: 9
Nick w MP: Damianek
Wysłany: 2019-02-21, 20:59
Gravgor
Wiek: 22 Na forum: 3619 dni Posty: 380
Nick w MP: 1944
Piwa : 702
Masz dany poziom admina?
Podpis
Portfolio marceliborowczak.me
Wysłany: 2019-02-22, 00:22
EinfachFischi
Wiek: 23 Na forum: 2744 dni Posty: 9
Nick w MP: Damianek
Tak
[ Dodano : 2019-02-22, 13:47 ]
Prosz? o pomoc
[ Dodano : 2019-02-22, 13:47 ]
Prosz? o pomoc
Tagi: komendy :: admina
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: