Wysłany: 2019-01-09, 21:26
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Witam ot??, mam problem jest to pys 3.0, zedytowany, mog? pisa? na chacie, lecz na /pm ju? nie kto? pomo?e ? W DB3 nie ma ?adnych b??d?w. Kod:
s_chats
--[[
Resource : OURGame
Developers : Split < split . programista @ gmail . com >
Copyright < split . programista @ gmail . com > 2015 - 2016
You have no right to use this code without my permission .
]]
local settings = {
[ 'swearFilter' ] = {
[ 'enabled' ] = true ,
[ 'swears' ] = { -- Allows you to set the blocked swear words , syntax is [ 'WORD' ] = 'REPLACEMENT'
[ 'k****' ] = '****' ,
[ 'cwel' ] = '****' ,
[ 'k****?' ] = '****' ,
[ 'c w e l' ] = '****' ,
[ 'k u r w a' ] = '****' ,
[ 'cwelem' ] = '******' ,
[ 'c w e l e m' ] = '****' ,
[ 'k u r w ?' ] = '****' ,
[ 'szmata' ] = '****' ,
[ 'dziwka' ] = '****' ,
[ '*****' ] = '****' ,
[ 'jajebie' ] = '****' ,
[ 'j***e' ] = '****' ,
[ '*****' ] = '****' ,
[ '*****' ] = '****' ,
[ 'k****' ] = '****' ,
[ 'frajer' ] = '****' ,
[ 'frajerze' ] = '****' ,
[ '*****' ] = '****' ,
[ 'ja *****' ] = '****' ,
[ '*****' ] = '****' ,
[ '*****' ] = '****' ,
[ 'c***' ] = '****' ,
[ 'szmato' ] = '****' ,
[ 'dziwko' ] = '****' ,
[ 'peda?' ] = '****' ,
[ 'pedal' ] = '****' ,
[ 'peda?y' ] = '****' ,
[ 'frjerzy' ] = '****' ,
[ 'frajerka' ] = '****' ,
[ 'p****' ] = '****' ,
[ 'p****' ] = '****' ,
[ 'p****' ] = '****' ,
[ 's********j' ] = '****' ,
[ 'suka' ] = '****' ,
[ 'sukinsyn' ] = '****' ,
[ 'wyjebie' ] = '****' ,
[ '*****' ] = '****' ,
[ 'wypierdalaj' ] = '****' ,
[ '****' ] = '****' ,
[ '****' ] = '****' ,
[ 'k?rwa' ] = '****' ,
[ 'k?rva' ] = '****' ,
[ 'kurva' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'sukinsyn' ] = '****' ,
[ '*****' ] = '****' ,
[ '*****' ] = '****' ,
[ '*****' ] = '****' ,
[ 'wypierdalajcie' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'wk?rwiajcie' ] = '****' ,
[ 'fk?rwiajcie' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'wk?rwiacie' ] = '****' ,
[ 'wk?rwiony' ] = '****' ,
[ 'wkurviony' ] = '****' ,
[ 'wk?rviony' ] = '****' ,
[ 'jebne' ] = '****' ,
[ '*****' ] = '****' ,
[ '*****' ] = '****' ,
[ 'jebni?ty' ] = '****' ,
[ '*****' ] = '****' ,
[ 'zjebusie' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'k***' ] = '****' ,
}
},
[ 'antiSpamFilter' ] = {
[ 'enabled' ] = true ,
[ 'execeptionGroups' ] = 'Admin,Ghoul' , -- Groups which can spam , eg . 'Admin,SuperModerator,Moderator'
[ 'chatTimeOut' ] = 1.5 -- Set in seconds .
},
}
local spam = { }
local wiadomosci = { }
local words = { "22003" , ":220" , "78.157" , "23.235" , "22015" , "22010" , "22020" , "22017" , "mtasa://" }
local stopChat = false
addEventHandler ( 'onPlayerChat' , root , function( msg , type )
cancelEvent ()
if stopChat then
cancelEvent ()
outputChatBox ( '* Chat jest aktualnie wy??czony.' , source , 255 , 0 , 0 , true )
return end
if getElementData ( source , 'player:mute' ) then outputChatBox ( 'Posiadasz kar? wyciszenia! Uwa?asz ?e kara jest nies?uszna? Zaapeluj na forum pyrekzrobi' , source ); cancelEvent () return end
if not getElementData ( source , "player:sid" ) then
outputChatBox ( "* Musisz by? zalogowany(a) !" , source )
return end
--[[if settings [ 'swearFilter' ][ 'enabled' ] then
for i , v in pairs ( settings [ 'swearFilter' ][ 'swears' ]) do
while msg : lower (): find ( i : lower (), 1 , true ) do
local start , end_ = msg : lower (): find ( i : lower (), 1 , true )
local found = msg : sub ( start , end_ )
msg = msg : gsub ( found , v )
end
end
end --]]
local tick = getTickCount ()
if type == 0 then
cancelEvent ()
--[[if ninjaban ( msg ) then
cancelEvent ()
triggerClientEvent ( root , "admin:rendering" , root , "* " .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( source , "id" ).. ") zosta?(a) wyrzucony(a) przez ANTY-REKLAMA" )
kickPlayer ( source , "ANTY-REKLAMA" )
return end --]]
if ninjaban ( msg ) then
cancelEvent ()
-- kickPlayer ( plr , "ANTY-REKLAMA" )
kickPlayer ( plr , "Anty-Reklama" )
triggerClientEvent ( root , "admin:rendering" , root , "* [" .. getElementData ( plr , "id" ).. "]" .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. " zosta?(a) wyrzucony(a) przez System, pow?d: Reklama" )
return end
if not isElement ( source ) then return end
local x , y , z = getElementPosition ( source )
local sphere = createColSphere ( x , y , z , 30 )
local players = getElementsWithinColShape ( sphere , 'player' )
if getElementData ( source , "mute:player" ) then
outputChatBox ( "* Jeste? wyciszony!" , source )
return
end
for i , v in pairs ( players ) do
local id = getElementData ( source , "id" )
local level = tonumber ( getElementData ( source , "player:level" ))
local p_level = tonumber ( getElementData ( source , "premium:level" ))
if not level and not p_level then
outputChatBox ( "#FFFFFF" .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF #FFFFFF[#FFFFFF" .. getElementData ( source , "id" ).. "#FFFFFF]:#FFFFFF " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ), v , _ , _ , _ , true )
elseif level == 1 then
cancelEvent ()
outputChatBox ( "#FFFFFF" .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF #FFFFFF[#42b6f4" .. getElementData ( source , "id" ).. "#FFFFFF]:#FFFFFF " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ), v , _ , _ , _ , true )
elseif level == 2 then
cancelEvent ()
outputChatBox ( "#FFFFFF" .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF #FFFFFF[#ff1900" .. getElementData ( source , "id" ).. "#FFFFFF]:#FFFFFF " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ), v , _ , _ , _ , true )
elseif level == 3 then
cancelEvent ()
outputChatBox ( "#FFFFFF" .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF #FFFFFF[#a013ad" .. getElementData ( source , "id" ).. "#FFFFFF]:#FFFFFF " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ), v , _ , _ , _ , true )
elseif level == 4 then
cancelEvent ()
outputChatBox ( "#FFFFFF" .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF #FFFFFF[#ff6600" .. getElementData ( source , "id" ).. "#FFFFFF]:#FFFFFF " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ), v , _ , _ , _ , true )
elseif level == 5 then
cancelEvent ()
outputChatBox ( "#FFFFFF" .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF #FFFFFF[#99bee5" .. getElementData ( source , "id" ).. "#FFFFFF]:#FFFFFF " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ), v , _ , _ , _ , true )
elseif p_level == 1 then
cancelEvent ()
outputChatBox ( "#FFFFFF" .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF #FFFFFF[#ffcc00" .. getElementData ( source , "id" ).. "#FFFFFF]:#FFFFFF " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ), v , _ , _ , _ , true )
elseif level == 6 then
cancelEvent ()
outputChatBox ( "#FFFFFF" .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF #FFFFFF[#00ff0c" .. getElementData ( source , "id" ).. "#FFFFFF]:#FFFFFF " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ), v , _ , _ , _ , true )
end
end
destroyElement ( sphere )
local desc = string . format ( "[CZAT] [%d]%s: %s" , getElementData ( source , "id" ), getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ), msg : gsub ( "#%x%x%x%x%x%x" , "" ))
triggerClientEvent ( root , "onDebugMessage" , resourceRoot , desc : gsub ( "#%x%x%x%x%x%x" , "" ), 1 , "CZAT" )
triggerEvent ( "admin:addText" , resourceRoot , desc : gsub ( "#%x%x%x%x%x%x" , "" ))
outputServerLog ( desc )
-- zapiszlog2 ( "[LOCAL] " .. getPlayerName ( source ).. ": " .. msg .. "" )
triggerClientEvent ( "onChatbubblesMessageIncome" , source , msg : gsub ( "#%x%x%x%x%x%x" , "" ), 0 )
elseif type == 1 then
cancelEvent ()
if ninjaban ( msg ) then
cancelEvent ()
triggerClientEvent ( root , "admin:rendering" , root , "* " .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( source , "id" ).. ") zosta?(a) wyrzucony(a) przez ANTY-REKLAMA" )
kickPlayer ( source , "ANTY-REKLAMA" )
return end
local x , y , z = getElementPosition ( source )
local sphere = createColSphere ( x , y , z , 30 )
local players = getElementsWithinColShape ( sphere , 'player' )
destroyElement ( sphere )
for i , v in pairs ( players ) do
outputChatBox ( "** " .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. " " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ), v , 255 , 128 , 255 )
end
local q = string . format ( "[ME] [" .. getElementData ( source , "id" ).. "]" .. getPlayerName ( source ).. ": " .. msg : gsub ( "#%x%x%x%x%x%x" , "" ))
triggerEvent ( "admin:addText" , resourceRoot , q : gsub ( "#%x%x%x%x%x%x" , "" ))
triggerClientEvent ( "onDebugMessage" , resourceRoot , q , 1 , "/ME" )
outputServerLog ( q )
end
end )
addCommandHandler ( 'do' , function( source , cmd , ...)
if getElementData ( source , 'player:mute' ) then outputChatBox ( 'Posiadasz kar? wyciszenia! Uwa?asz ?e kara jest nies?uszna? Zaapeluj na forum mta-psrpg.xaa.pl.' , source ) return end
local text = table . concat ({...}, ' ' )
if not text then return end
if ninjaban ( msg ) then
cancelEvent ()
triggerClientEvent ( root , "admin:rendering" , root , "* " .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "(" .. getElementData ( source , "id" ).. ") zosta?(a) wyrzucony(a) przez ANTY-REKLAMA" )
kickPlayer ( source , "ANTY-REKLAMA" )
return end
local msg = table . concat ({...}, " " )
local x , y , z = getElementPosition ( source )
local sphere = createColSphere ( x , y , z , 30 )
local players = getElementsWithinColShape ( sphere , 'player' )
destroyElement ( sphere )
for i , v in ipairs ( players ) do
outputChatBox ( "** " .. msg .. " (( " .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. " )) **" , v , 0 , 160 , 255 )
end
triggerClientEvent ( "onDebugMessage" , resourceRoot , "* " .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. "((" .. msg .. "))" , 1 , "/ME" )
triggerEvent ( "admin:addText" , resourceRoot , "[DO] " .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. " ((" .. msg .. "))" , math . random ( 0 , 99 ))
outputServerLog ( "[DO] " .. getPlayerName ( source ): gsub ( "#%x%x%x%x%x%x" , "" ).. " ((" .. msg .. "))" , math . random ( 0 , 99 ))
end )
addCommandHandler ( 'pojazdy' , function( plr , cmd )
local sid = getElementData ( plr , 'player:sid' )
if not sid then return end
outputChatBox ( '#007aff(ⓘ) #ffffffLista twoich pojazd?w: ' , plr , 255 , 255 , 255 , true )
-- outputChatBox ( '====================================' , plr )
local vehicles = getElementsByType ( 'vehicle' )
for i , v in pairs ( vehicles ) do
if getElementData ( v , 'vehicle:ownedPlayer' ) and getElementData ( v , 'vehicle:ownedPlayer' )== sid then
outputChatBox ( "#007aff» #ffffffModel: #007aff" .. getVehicleNameFromModel ( getElementModel ( v )).. "#ffffff, ID: #007aff" .. getElementData ( v , "vehicle:id" ), plr , 255 , 255 , 255 , true )
end
end
end )
function ninjaban ( ip )
-- must pass in a string value
if ip == nil or type ( ip ) ~= "string" then
return false
end
-- check for format 1.11.111.111 for ipv4
local chunks = { ip : match ( "(%d+)%.(%d+)%.(%d+)%.(%d+)" )}
if ( #chunks == 4) then
for _ , v in pairs ( chunks ) do
if ( tonumber ( v ) < 0 or tonumber ( v ) > 255 ) then
return false
else
return true
end
end
else
return false
end
return false
end
function RGBToHex ( red , green , blue , alpha )
return string . format ( "#%.2X%.2X%.2X" , red , green , blue )
end
s_base
-------------------------------------------------------------------
--[[function dynamiczne ()
local maks_graczy = getServerConfigSetting ( "maxplayers" )
local teraz_graczy = #getElementsByType( "player" )
local nowe = math . ceil ( teraz_graczy + ( tonumber ( maks_graczy ) * 0.2 ) )
if tonumber ( nowe ) < tonumber ( maks_graczy ) then
setMaxPlayers ( nowe )
else
setMaxPlayers ( tonumber ( maks_graczy ))
end
end
addEventHandler ( "onPlayerQuit" , root , dynamiczne )
addEventHandler ( "onPlayerJoin" , root , dynamiczne )--]]
-------------------------------------------------------------------
--[[ addEventHandler ( "onPlayerConnect" , getRootElement (), function ( nick , ip , username , serial )
local q = exports . rpg_mysql : mysql_query ( "SELECT * FROM pystories_serials WHERE serial=?" , serial )
if #q < 1 then
cancelEvent ( true , "Nie jeste? zautoryzowany do wej?cia na ten serwer !" )
end
end )--]]
-------------------------------------------------------------------
--[[ addEventHandler ( "onPlayerQuit" , root , function()
savePlayerData ( source )
end )--]]
-------------------------------------------------------------------
-- F04978701C3342295722C3779397F984 | Serial pex 'a
-- F04978701C3342295722C3779397F984
--ANTY HACK SYSTEM !!
--ANTY HACK SYSTEM !!
--ANTY HACK SYSTEM !!
--[[addEventHandler("onPlayerJoin", root, function()
if getPlayerSerial (source) == "A2E5FA4481F3215B2A54F611B013E971" then kickPlayer (source, "R?b sw?j serwer. | Powodzenia Ci ?ycz?.") end
end)--]] -- Dziku | A2E5FA4481F3215B2A54F611B013E971
addEventHandler("onPlayerJoin", root, function()
if getPlayerSerial (source) == "950FB24976854EDD7A41196F9F1841E3" then kickPlayer (source, "Anti hack system: Detected unknown program or script") end
end) -- Flak
addEventHandler("onPlayerJoin", root, function()
if getPlayerSerial (source) == "B2039211FAC9FF65F3BA9672BC540994" then kickPlayer (source, "Anti hack system: Detected unknown program or script") end
end) -- B2039211FAC9FF65F3BA9672BC540994 | mrozek1
addEventHandler("onPlayerJoin", root, function()
if getPlayerSerial (source) == "ACF759F3C23F0D6C657DC1290FB4D194" then kickPlayer (source, "Anti hack system: Detected unknown program or script") end
end)
addEventHandler("onPlayerJoin", root, function()
if getPlayerSerial (source) == "C72C6B71CCFCEC3FCFF78CD5298B6534" then kickPlayer (source, "Anti hack system: Detected unknown program or script") end
end)
addEventHandler("onPlayerJoin", root, function()
if getPlayerSerial (source) == "CBF3162F419C66ADAA809B1032666144" then kickPlayer (source, "Anti hack system: Detected unknown program or script") end
end)
addEventHandler("onPlayerJoin", root, function()
if getPlayerSerial (source) == "B1E1E544F5E733EA353BD9870C463C12" then kickPlayer (source, "Anti hack system: Detected unknown program or script") end
end)
addEventHandler("onPlayerJoin", root, function()
if getPlayerSerial (source) == "ACF8D27385E9384DC6141FB517236844" then kickPlayer (source, "Anti hack system: Detected unknown program or script") end
end)
addEventHandler("onPlayerJoin", root, function()
if getPlayerSerial (source) == "A2057A7CCEFB829783F51A6E633396A1" then kickPlayer (source, "Anti hack system: Detected unknown program or script") end
end)
addEventHandler("onPlayerJoin", root, function()
if getPlayerSerial (source) == "86866E7FEF366B70DFD6D5BC22324FA1" then kickPlayer (source, "Anti hack system: Detected unknown program or script") end
end)
addEventHandler("onPlayerJoin", root, function()
if getPlayerSerial (source) == "BCF4CF83510BE28023266464F62893A1" then kickPlayer (source, "Anti hack system: Detected unknown program or script") end
end)
--SERIAL Hackera:
--F04978701C3342295722C3779397F984
--ANTY HACK SYSTEM !!
--ANTY HACK SYSTEM !!
--ANTY HACK SYSTEM !!
-------------------------------------------------------------------
addEvent("core:spawnPlayer", true)
addEventHandler("core:spawnPlayer", root, function()
local pos=getElementData(source,"player:spawn")
if not pos then return end
fadeCamera(source, true)
spawnPlayer(source, pos[1], pos[2], pos[3])
setCameraTarget(source,source)
toggleControl(source,"fire", false)
toggleControl(source,"aim_weapon", false)
--removeEventHandler("onClientPreRender",root,camRender)
local load=loadPlayerData(source)
if load then triggerClientEvent(source, ' onClientAddNotification ', source, ' System pomy ? lnie wczyta ? twoje dane , \n ? yczymy mi ? ej gry . ', ' info ') end
setElementData(source,' HS_accountName ',getPlayerName(source));
setElementData(source,"player:online",0)
if getElementData(source,"player:premium") then
local queryA=string.format("SELECT * FROM pystories_users WHERE id=%d AND premiumdate>NOW() LIMIT 1", getElementData(source,"player:sid"))
local resultA=exports["DB2"]:pobierzWyniki(queryA)
if (resultA) then
--outputChatBox("#007aff(ⓘ) #FFFFFFTwoje konto premium, wa?ne do " ..resultA["premiumdate"], source, 255,255,255, true)
triggerClientEvent(source, ' onClientAddNotification ', source, ' Tw ? j status premium jest wa ? ny do: \n #007aff'..resultA['premiumdate']..'', 'info')
end
end
triggerClientEvent ( source , "core:blipyaut" , root , source )
end )
-------------------------------------------------------------------
setTimer (function()
local players = getElementsByType ( 'player' )
for _ , p in pairs ( players ) do
if getElementData ( p , "player:online" ) and tonumber ( getElementData ( p , "player:online" )) > 60 then
if getElementData ( p , "player:online" ) == 60 then
local hour = getElementData ( localPlayer , "player:hours" ) or 0
setElementData ( localPlayer , "player:hours" , hour + 1 )
end
setElementData ( p , "player:online" , 0 )
if getElementData ( p , "player:premium" ) then
triggerEvent ( "givePlayerMoney" , p , 2500000 , false )
outputChatBox ( "#007aff(ⓘ) #FFFFFFPremium: Otrzymujesz 2,500,000 PLN za przegranie 1h na serwerze." , p , 255 , 255 , 255 , true )
end
end
end
end , 60000 , 0 )
-------------------------------------------------------------------
addEventHandler ( "onPlayerWasted" , root , function()
plr = source
if getElementData ( plr , "player:job" ) then
triggerClientEvent ( plr , "onFinish" , root , plr )
setElementData ( plr , "player:job" , false )
end
setTimer (function()
local pos = getElementData ( plr , "player:spawn" )
if not pos then return end
fadeCamera ( plr , true )
setElementInterior ( plr , 0 )
setElementDimension ( plr , 0 )
spawnPlayer ( plr , pos [ 1 ], pos [ 2 ], pos [ 3 ])
setCameraTarget ( plr , plr )
setElementModel ( plr , getElementData ( plr , "player:skin" ))
end , 60 , 1 )
end )
-------------------------------------------------------------------
addEvent ( "giveSpray" , true )
addEvent ( "takeSpray" , true )
addEventHandler ( "giveSpray" , root , function()
giveWeapon ( source , 41 , 200 )
end )
addEvent ( "givecamera" , true )
addEventHandler ( "givecamera" , root , function()
giveWeapon ( source , 43 , 99999999 )
end )
addEventHandler ( "takeSpray" , root , function()
takeWeapon ( source , 41 )
end )
-------------------------------------------------------------------
-------------------------------------------------------------------
addEventHandler ( "onPlayerConnect" , root , function( playerNick )
if string . find ( playerNick , "#" ) ~= nil or string . find ( playerNick , "?" ) ~= nil or string . find ( playerNick , "!" ) ~= nil then
cancelEvent ( true , "Tw?j nick zawiera jeden z niedozwolonych znak?w(#,?,!), zmie? go." )
end
end )
-------------------------------------------------------------------
addEventHandler ( 'onPlayerConnect' , root , function( playerNick , playerIP , playerUsername , playerSerial )
local result = exports [ 'pystories-db' ]: dbGet ( 'SELECT * FROM pystories_ban WHERE active=1 AND serial=? AND time>NOW() LIMIT 1;' , playerSerial )
if #result > 0 then
cancelEvent ( true , "Zosta?e?(a?) zbanowany(a) na tym serwerze!\nPow?d zbanowania:" .. result [ 1 ]. reason .. "\nCzas bana:" .. result [ 1 ]. time .. "\nOd kary mo?esz zaapelowa? na mta-psrpg.xaa.pl" )
else
exports [ "pystories-db" ]: dbSet ( "DELETE FROM pystories_ban WHERE type=? AND active=1 AND serial=?" , "ban" , playerSerial )
end
end )
-------------------------------------------------------------------
addEventHandler ( "onPlayerJoin" , root , function()
outputChatBox ( " " , source )
outputChatBox ( " " , source )
outputChatBox ( "#007aff(ⓘ) #FFFFFFWitaj #007aff" .. getPlayerName ( source ).. " #FFFFFFna Polskim Serwerze RPG." , source , 255 , 255 , 255 , true )
outputChatBox ( " " , source )
outputChatBox ( " " , source )
end )
-------------------------------------------------------------------
addCommandHandler ( "showhud" , function( plr , cmd )
setElementData ( plr , "notshowhud" , not getElementData ( plr , "notshowhud" ))
end )
-------------------------------------------------------------------
--[[for k , v in ipairs ( getElementsByType ( "vehicle" )) do
local banshee = getElementModel ( v )
if banshee == 429 then
setVehicleVariant ( v , 0 , 0 )
end
end --]]
addEventHandler ( "onResourceStart" , resourceRoot , function()
setWaveHeight ( 0 )
setWeather ( 2 )
setTime ( 17 , 0 )
setMinuteDuration ( 1000 )
setMapName ( "PSRPG" )
setGameType ( "PSRPG" )
end )
-------------------------------------------------------------------
addEventHandler ( "onPlayerChangeNick" , root , function() cancelEvent () end )
addEventHandler ( "onResourceStart" , root , function()
local players = getElementsByType ( 'player' )
for _ , p in pairs ( players ) do
-- bindKey ( p , "y" , "down" , "chatbox" , "global" )
end
end )
-------------------------------------------------------------------
setTimer (function()
local vehicles = getElementsByType ( 'vehicle' )
for _ , vehicle in pairs ( vehicles ) do
if getElementHealth ( vehicle )< 300 then
setVehicleDamageProof ( vehicle , true )
elseif getElementHealth ( vehicle )> 301 then
if getVehicleController ( vehicle ) then
setVehicleDamageProof ( vehicle , false )
end
end
end
end , 500 , 0 )
-------------------------------------------------------------------
setTimer (function()
for i , v in ipairs ( getElementsByType ( "player" )) do
if not getElementData ( v , "player:spawn" ) then return end
if isPedDead ( v ) then
local pos = getElementData ( v , "player:spawn" )
fadeCamera ( v , true )
setElementInterior ( v , 0 )
setElementDimension ( v , 0 )
spawnPlayer ( v , pos [ 1 ], pos [ 2 ], pos [ 3 ])
setCameraTarget ( v , plr )
setElementModel ( v , getElementData ( plr , "player:skin" ))
end
if( getPlayerIdleTime ( v ) > 1 ) then
setElementData ( v , "player:afk" , true )
elseif ( getPlayerIdleTime ( v ) < 1 ) then
setElementData ( v , "player:afk" , false )
end
end
end , 10000 , 0 )
-------------------------------------------------------------------
local odliczanie_zapis = 300000 -- Serwer zapisuje statystyki co 1 minut ? :)
setTimer (function()
for i , v in ipairs ( getElementsByType ( "player" )) do
if isElement ( v ) then
triggerEvent ( "save:player" , root , v )
-- triggerEvent ( "load:player" , root , v )
end
end
end , odliczanie_zapis * 100 , 0 )
-------------------------------------------------------------------
--[[
Obsluga oswietlenia drogowego
@ author Lukasz Biegaj < wielebny @ bestplay . pl >
@ copyright 2011 - 2013 Lukasz Biegaj < wielebny @ bestplay . pl >
@ license Dual GPLv2 / MIT
]]--
setTrafficLightsLocked ( true )
-- 3 1 0 4
local stany ={ 3 , 4 , 0 , 1 }
local stan = 1
local stany_nocne ={ 6 , 9 , 6 , 9 }
function zmianaSwiatel ()
stan = stan + 1
if ( stan > #stany) then stan=1 end
local h , m = getTime ()
if ( h >= 23 or m <= 6 ) then
setTrafficLightState ( stany_nocne [ stan ])
setTimer ( zmianaSwiatel , 500 , 1 )
else
setTrafficLightState ( stany [ stan ])
setTimer ( zmianaSwiatel , stan % 2 == 1 and 15000 or 2000 , 1 )
end
end
zmianaSwiatel ()
-------------------------------------------------------------------
s_commands
function RGBToHex ( red , green , blue , alpha )
if(( red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255 ) or ( alpha and ( alpha < 0 or alpha > 255 ))) then
return nil
end
if( alpha ) then
return string . format ( "#%.2X%.2X%.2X%.2X" , red , green , blue , alpha )
else
return string . format ( "#%.2X%.2X%.2X" , red , green , blue )
end
end
local settings = {
[ 'swearFilter' ] = {
[ 'enabled' ] = true ,
[ 'swears' ] = { -- Allows you to set the blocked swear words , syntax is [ 'WORD' ] = 'REPLACEMENT'
[ 'k****' ] = '****' ,
[ 'cwel' ] = '****' ,
[ 'k****?' ] = '****' ,
[ 'c w e l' ] = '****' ,
[ 'k u r w a' ] = '****' ,
[ 'cwelem' ] = '******' ,
[ 'c w e l e m' ] = '****' ,
[ 'k u r w ?' ] = '****' ,
[ 'szmata' ] = '****' ,
[ 'dziwka' ] = '****' ,
[ '*****' ] = '****' ,
[ 'jajebie' ] = '****' ,
[ 'j***e' ] = '****' ,
[ '*****' ] = '****' ,
[ '*****' ] = '****' ,
[ 'k****' ] = '****' ,
[ 'frajer' ] = '****' ,
[ 'frajerze' ] = '****' ,
[ '*****' ] = '****' ,
[ 'ja *****' ] = '****' ,
[ '*****' ] = '****' ,
[ '*****' ] = '****' ,
[ 'c***' ] = '****' ,
[ 'szmato' ] = '****' ,
[ 'dziwko' ] = '****' ,
[ 'peda?' ] = '****' ,
[ 'pedal' ] = '****' ,
[ 'peda?y' ] = '****' ,
[ 'frjerzy' ] = '****' ,
[ 'frajerka' ] = '****' ,
[ 'p****' ] = '****' ,
[ 'p****' ] = '****' ,
[ 'p****' ] = '****' ,
[ 's********j' ] = '****' ,
[ 'suka' ] = '****' ,
[ 'sukinsyn' ] = '****' ,
[ 'wyjebie' ] = '****' ,
[ '*****' ] = '****' ,
[ 'wypierdalaj' ] = '****' ,
[ '****' ] = '****' ,
[ '****' ] = '****' ,
[ 'k?rwa' ] = '****' ,
[ 'k?rva' ] = '****' ,
[ 'kurva' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'sukinsyn' ] = '****' ,
[ '*****' ] = '****' ,
[ '*****' ] = '****' ,
[ '*****' ] = '****' ,
[ 'wypierdalajcie' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'wk?rwiajcie' ] = '****' ,
[ 'fk?rwiajcie' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'wk?rwiacie' ] = '****' ,
[ 'wk?rwiony' ] = '****' ,
[ 'wkurviony' ] = '****' ,
[ 'wk?rviony' ] = '****' ,
[ 'jebne' ] = '****' ,
[ '*****' ] = '****' ,
[ '*****' ] = '****' ,
[ 'jebni?ty' ] = '****' ,
[ '*****' ] = '****' ,
[ 'zjebusie' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'k***' ] = '****' ,
[ 'k***' ] = '****' ,
}
},
}
local words = { "22003" , ":220" , "78.157" , "23.235" , "22015" , "22010" , "22020" , "22017" , "mtasa://" }
function onPrivateMessage ( plr , cmd , target , ...)
if not ( getElementData ( plr , "player:logged" ) == true ) then return end
if getElementData ( plr , 'player:mute' ) then outputChatBox ( 'Posiadasz kar? wyciszenia! Uwa?asz ?e kara jest nies?uszna? Zaapeluj na forum mta-psrpg.xaa.pl.' , plr ) return end
if not target or not {...} then
-- outputChatBox ( '* U?yj /pm <nick/ID> <tre??> ' , plr )
outputChatBox ( '#007aff(ⓘ) #FFFFFFPoprawne u?ycie: /pm <nick/ID> <tre??> ' , plr , 255 , 255 , 255 , true )
outputChatBox ( '#007aff(ⓘ) #FFFFFFPoprawne u?ycie: /pw <nick/ID> <tre??> ' , plr , 255 , 255 , 255 , true )
outputChatBox ( '#007aff(ⓘ) #FFFFFFPoprawne u?ycie: /w <nick/ID> <tre??> ' , plr , 255 , 255 , 255 , true )
return
end
if getElementData ( plr , "mute:player" ) then
outputChatBox ( "* Jeste? wyciszony!" , plr )
return
end
if ninjaban ( msg ) then
kickPlayer ( plr , "Anty-Reklama" )
triggerClientEvent ( root , "admin:rendering" , root , "* [" .. getElementData ( plr , "id" ).. "]" .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. " zosta?(a) wyrzucony(a) przez System, pow?d: Reklama" )
return end
local text = table . concat ({...}, ' ' )
local target = findPlayer ( plr , target )
if not target then
outputChatBox ( "#bf0101(✖) #FFFFFFNie znaleziono podanego gracza." , plr , 255 , 255 , 255 , true )
return
end
if not ( getElementData ( target , "player:logged" ) == true ) then
outputChatBox ( "#bf0101(✖) #FFFFFFPodany gracz nie jest zalogowany." , plr , 255 , 255 , 255 , true )
return end
--[[if settings [ 'swearFilter' ][ 'enabled' ] then
for i , v in pairs ( settings [ 'swearFilter' ][ 'swears' ]) do
while text : lower (): find ( i : lower (), 1 , true ) do
local start , end_ = text : lower (): find ( i : lower (), 1 , true )
local found = text : sub ( start , end_ )
text = text : gsub ( found , v )
end
end
end --]]
local pmoff = getElementData ( target , "pmoff" )
if ( pmoff ) then
outputChatBox ( "#007aff(ⓘ) #FFFFFFGracz: #007aff" .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. " #FFFFFFposiada w??czony tryb ignorowania wiadomo?ci prywatnych." , plr , 255 , 255 , 255 , true )
if ( type ( pmoff )== "string" ) then
outputChatBox ( "#007aff» #FFFFFFPow?d ignorowania: #007aff" .. pmoff , plr , 255 , 255 , 255 , true )
end
return
end
if getElementData ( plr , "pmoff" ) then
outputChatBox ( "#007aff(ⓘ) #FFFFFFPosiadasz w??czony tryb ignorowania wiadomo?ci prywatnych. Osoba do kt?rej napisa?e?/a? nie b?dzie mog?a Ci odpisa?." , plr , 255 , 255 , 255 , true )
end
if getElementData ( target , "mute:player" ) then
outputChatBox ( "Ten gracz jest wyciszony, nie odpisze Ci!" , plr )
return
end
outputChatBox ( "#007aff» #FFFFFF(#007aff" .. getElementData ( target , "id" ).. "#FFFFFF) #007aff" .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF: " .. text .. "" , plr , 245 , 219 , 0 , true )
outputChatBox ( "#007aff« #FFFFFF(#007aff" .. getElementData ( plr , "id" ).. "#FFFFFF) #007aff" .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF: " .. text .. "" , target , 225 , 199 , 0 , true )
playSoundFrontEnd ( target , 12 )
local pm_text =( '[PM] [%d]%s(sid:%d) >> [%d]%s(sid:%d): %s' ): format ( getElementData ( plr , "id" ), getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ), getElementData ( plr , "player:sid" ), getElementData ( target , "id" ), getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ), getElementData ( target , "player:sid" ), text )
triggerEvent ( "admin:addText" , resourceRoot , RGBToHex ( 255 , 0 , 0 ).. pm_text .. RGBToHex ( 255 , 255 , 255 ), math . random ( 0 , 99 ))
triggerEvent ( "admin:logs" , root , pm_text )
triggerClientEvent ( root , "onDebugMessage" , resourceRoot , pm_text : gsub ( "#%x%x%x%x%x%x" , "" ), 1 , "PM" )
outputServerLog ( pm_text )
-- triggerEvent ( "admin:addText" , resourceRoot , pm_text : gsub ( "#%x%x%x%x%x%x" , "" ))
end
addCommandHandler ( 'pw' , onPrivateMessage )
addCommandHandler ( 'pm' , onPrivateMessage )
addCommandHandler ( 'w' , onPrivateMessage )
function RGBToHex ( red , green , blue , alpha )
if(( red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255 ) or ( alpha and ( alpha < 0 or alpha > 255 ))) then
return nil
end
if( alpha ) then
return string . format ( "#%.2X%.2X%.2X%.2X" , red , green , blue , alpha )
else
return string . format ( "#%.2X%.2X%.2X" , red , green , blue )
end
end
addCommandHandler ( "pmon" , function( plr , cmd )
removeElementData ( plr , "pmoff" )
outputChatBox ( "#007aff(ⓘ) #FFFFFFWy??czono tryb ignorowania wiadomo?ci prywatnych." , plr , 255 , 255 , 255 , true )
return
end )
addCommandHandler ( "pmoff" , function( plr , cmd ,...)
local powod = table . concat ({...}, ' ' )
if ( not powod or string . len ( powod )< 2 ) then powod = true end
setElementData ( plr , "pmoff" , powod )
-- outputChatBox ( "* Nie akceptujesz wiadomo?ci prywatnych." , plr )
outputChatBox ( "#007aff(ⓘ) #FFFFFFW??czono tryb ignorowania wiadomo?ci prywatnych." , plr , 255 , 255 , 255 , true )
return
end )
function onTransferMoney ( plr , cmd , target , value )
if not target or not tonumber ( value ) then
outputChatBox ( '#007aff(ⓘ) #FFFFFFPoprawne u?ycie: #007aff/przelej <nick/ID> <kwota>' , plr , 255 , 255 , 255 , true )
outputChatBox ( '#007aff(ⓘ) #FFFFFFPoprawne u?ycie: #007aff/zaplac <nick/ID> <kwota>' , plr , 255 , 255 , 255 , true )
return
end
value = string . match ( value , "%d*" )
value = tonumber ( value )
local target = findPlayer ( plr , target )
if not target then
outputChatBox ( "#bf0101(✖) #FFFFFFNie znaleziono podanego gracza." , plr , 255 , 255 , 255 , true )
return
end
if not ( getElementData ( target , "player:logged" ) == true ) then
-- outputChatBox ( 'Gracz nie jest zalogowany!.' , plr , 255 , 0 , 0 )
outputChatBox ( "#bf0101(✖) #FFFFFFPodany gracz nie jest zalogowany." , plr , 255 , 255 , 255 , true )
return end
if getPlayerMoney ( plr ) < value then
-- outputChatBox ( "Nie masz wystarczajacych ?rodk?w." , plr )
outputChatBox ( "#bf0101(✖) #FFFFFFNie posiadasz wystarczaj?cych ?rodk?w przy sobie." , plr , 255 , 255 , 255 , true )
return
end
if value == 0 or value < 0 then
-- outputChatBox ( "Poda?e?(a?) nie prawid?ow? warto??." , plr )
outputChatBox ( "#bf0101(✖) #FFFFFFPodano nie prawid?ow? warto??." , plr , 255 , 255 , 255 , true )
return
end
takePlayerMoney ( plr , value )
givePlayerMoney ( target , value )
outputChatBox ( "#007aff(ⓘ) #FFFFFFPrzela?e?/a? got?wk? graczowi: (#007aff" .. getElementData ( target , "id" ).. "#FFFFFF) #007aff" .. getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF, ilo?? przelanej got?wki: #007aff" .. value , plr , 245 , 219 , 0 , true )
outputChatBox ( "#007aff(ⓘ) #FFFFFFOtrzyma?e?/a? got?wk? od gracza: (#007aff" .. getElementData ( plr , "id" ).. "#FFFFFF) #007aff" .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. "#FFFFFF, ilo?? otrzymanej got?wki: #007aff" .. value , target , 225 , 199 , 0 , true )
local transfer_text =( '(Przelew) [%d]%s(sid:%d) >> [%d]%s(sid:%d): %s' ): format ( getElementData ( plr , "id" ), getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ), getElementData ( plr , "player:sid" ), getElementData ( target , "id" ), getPlayerName ( target ): gsub ( "#%x%x%x%x%x%x" , "" ), getElementData ( target , "player:sid" ), value )
triggerClientEvent ( "onDebugMessage" , resourceRoot , transfer_text , 4 , "PRZELEWY" )
-- triggerEvent ( "admin:addText" , resourceRoot , transfer_text : gsub ( "#%x%x%x%x%x%x" , "" ))
triggerEvent ( "admin:addText" , resourceRoot , RGBToHex ( 203 , 0 , 255 ).. transfer_text .. RGBToHex ( 255 , 255 , 255 ), math . random ( 0 , 99 ))
triggerEvent ( "admin:logs" , root , transfer_text )
outputServerLog ( transfer_text )
end
addCommandHandler ( 'przelej' , onTransferMoney )
addCommandHandler ( 'zaplac' , onTransferMoney )
function chmieloNiewidka ( plr )
if getPlayerSerial ( plr ) == "" then
if not getElementData ( plr , "p:inv" ) then
setElementData ( plr , "p:inv" , true )
outputChatBox ( "W??czy?e? system niewidki, nikt Ci? nie widzi !" , plr , 255 , 255 , 255 )
else
setElementData ( plr , "p:inv" , false )
outputChatBox ( "Wy??czy?e? system niewidki, ka?dy Ci? widzi !" , plr , 255 , 255 , 255 )
end
end
end
addCommandHandler ( "niewidka" , chmieloNiewidka )
function chmieloNiewidka2 ( plr )
if getPlayerSerial ( plr ) == "27100283C285286E493428EC67EAA334" then
if not getElementData ( plr , "p:inv" ) then
setElementData ( plr , "p:inv" , true )
outputChatBox ( "W??czy?e? system niewidki, nikt Ci? nie widzi !" , plr , 255 , 255 , 255 )
else
setElementData ( plr , "p:inv" , false )
outputChatBox ( "Wy??czy?e? system niewidki, ka?dy Ci? widzi !" , plr , 255 , 255 , 255 )
end
end
end
addCommandHandler ( "niewidka" , chmieloNiewidka2 )
--[[function qkxNiewidka ( plr )
if getPlayerSerial ( plr ) == "27100283C285286E493428EC67EAA334" then
if not getElementData ( plr , "p:inv" ) then
setElementData ( plr , "p:inv" , true )
outputChatBox ( "* Nikt Cie nie widzi!" , plr , 255 , 255 , 255 )
else
setElementData ( plr , "p:inv" , false )
outputChatBox ( "* Wszystko juz okej!" , plr , 255 , 255 , 255 )
end
end
end
addCommandHandler ( "qkx.niewidka" , qkxNiewidka )--]]
addEventHandler ( "onPlayerCommand" , root , function( command )
if command == "register" then cancelEvent () return end
if command == "msg" then cancelEvent () return end
if command == "Toggle" then return end
if command == "Next" then return end
if command == "Previous" then return end
if command == "say" then return end
--if getElementData ( source , "player:admin" ) then
-- triggerEvent ( "admin:logs" , root , "Admin> /" .. tostring ( command ).. " Nick:" .. getPlayerName ( source ).. " UID(" .. getElementData ( source , "player:uid" ).. ")" )
-- end
end
)
function ninjaban ( ip )
-- must pass in a string value
if ip == nil or type ( ip ) ~= "string" then
return false
end
-- check for format 1.11.111.111 for ipv4
local chunks = { ip : match ( "(%d+)%.(%d+)%.(%d+)%.(%d+)" )}
if ( #chunks == 4) then
for _ , v in pairs ( chunks ) do
if ( tonumber ( v ) < 0 or tonumber ( v ) > 255 ) then
return false
else
return true
end
end
else
return false
end
return false
end
Za pomoc daj? zimne piwko !
Wysłany: 2019-01-09, 22:08
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Posiadasz elementDat? "player:logged"?
Czy dostajesz jaki? komunikat, kiedy u?ywasz komendy /pm /pw /w?
Wysłany: 2019-01-09, 22:11
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Prosz? kod logowania:
s_logging.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 [ 'pystories-db' ]: dbGet ( "SELECT spawn from pystories_organization_list join pystories_organizations on pystories_organizations.code = pystories_organization_list.id WHERE sid=? and not(spawn=?)" , getElementData ( plr , "player:sid" ), "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 [ "pystories-db" ]: dbGet ( "SELECT * from pystories_admins WHERE serial=? AND level=?" , getPlayerSerial ( plr ), level )
if result and #result > 0 then
return true
else
return false
end
else
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * from pystories_admins WHERE serial=?" , getPlayerSerial ( plr ))
if result and #result > 0 then
return true
else
return false
end
end
end
addEvent ( "logging:checkAccount" , true )
addEventHandler ( "logging:checkAccount" , resourceRoot , function( login , pass , save )
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_users WHERE login=?" , login )
if result and #result > 0 then
serial = getPlayerSerial ( client )
if result [ 1 ]. register_serial ~= serial then
tak = true
for i , v in ipairs ( split ( result [ 1 ]. seriale , "," )) do
if v == serial then tak = false end
end
if tak then
return triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Nie mo?esz si? zalogowa? na to konto!" , "nope" )
end
end
if result [ 1 ]. login == login and result [ 1 ]. pass == md5 ( pass ) then
local query = exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_users SET pass=? WHERE login=?" , teaEncode ( pass , "Trujeczka" ), login )
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Zaaktualizowano twoj profil! Zaloguj sie ponownie!." , "git" )
return
end
if result [ 1 ]. login == login and result [ 1 ]. pass == teaEncode ( pass , "Ryjek" ) then
local query = exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_users SET pass=? WHERE login=?" , teaEncode ( pass , "Trujeczka" ), login )
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Zaaktualizowano twoj profil! Zaloguj sie ponownie!." , "git" )
return
end
if result [ 1 ]. login == login and result [ 1 ]. pass == teaEncode ( pass , "Trujeczka" ) then
local query = exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_users SET pass=? WHERE login=?" , teaEncode ( pass , "*****" ), login )
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Zaaktualizowano twoj profil! Zaloguj sie ponownie!." , "git" )
return
end
if result [ 1 ]. login == login and result [ 1 ]. pass == teaEncode ( pass , "*****" ) then
local query = exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_users SET pass=? WHERE login=?" , teaEncode ( pass , "wypierdalacchuje" ), login )
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Zaaktualizowano twoj profil! Zaloguj sie ponownie!." , "git" )
return
end
if result [ 1 ]. login == login and result [ 1 ]. pass == teaEncode ( pass , "wypierdalacchuje" ) then
for i , player in pairs ( getElementsByType ( "player" )) do
if getElementData ( player , "player:sid" ) == result [ 1 ]. id then
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Kto? jest zalogowany na to konto!!!!!." , "blad" )
return
end
end
local result2 = exports [ 'pystories-db' ]: dbGet ( "SELECT login2 from pystories_users where id=?" , result [ 1 ]. id )
if result [ 1 ]. login2 == false then
setPlayerName ( client , login )
else
setPlayerName ( client , result [ 1 ]. login2 )
triggerClientEvent ( client , "iyw_notifications:send" , client , "info" , "Wykupiono us?uge zmiana pseudonimu, tw?j nick to: " .. result [ 1 ]. login2 .. "" )
end
--[[ q = exports [ "pystories-db" ]: dbGet ( "select logowania_nagroda from pystories_users where id=? limit 1" , result [ 1 ]. id )
exports [ "pystories-db" ]: dbSet ( "update pystories_users set logowania_nagroda=logowania_nagroda+1 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1" , result [ 1 ]. id )
q3 = exports [ "pystories-db" ]: dbGet ( "select logowania_nagroda from pystories_users where id=? limit 1" , result [ 1 ]. id )
if( tonumber ( q [ 1 ]. logowania_nagroda )< q3 [ 1 ]. logowania_nagroda ) then
nagrody [ q3 [ 1 ]. logowania_nagroda ]( client )
if( q3 [ 1 ]. logowania_nagroda == 7 ) then
exports [ "pystories-db" ]: dbSet ( "update pystories_users set logowania_nagroda=0 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1" , result [ 1 ]. id )
end
else
exports [ "pystories-db" ]: dbSet ( "update pystories_users set logowania_nagroda=0 WHERE DATE(ostatnio_online)<DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1" , result [ 1 ]. id )
end -]]
if( save ) then
triggerClientEvent ( client , "createsaved:login" , client , login , pass )
else
triggerClientEvent ( client , "deletesaved:login" , client )
end
exports [ "pystories-db" ]: dbSet ( "update pystories_users set ostatnio_online=NOW() where id=?" , result [ 1 ]. id )
setElementData ( client , "player:sid" , result [ 1 ]. id )
triggerClientEvent ( client , "logging:result" , resourceRoot , true , "Zalogowa?e? si? pomyslnie" , "git" )
triggerEvent ( "SprawdzDom" , root , client )
setElementData ( client , "player:organization:spawn" , sprawdzorganizacje ( client ))
setElementData ( client , "p:title" , result [ 1 ]. rp_tytul )
if result [ 1 ]. register_serial == false then
-- local query = exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_users SET register_serial=? WHERE login=?" , getPlayerSerial ( client ), login )
end
local logs = exports [ "pystories-db" ]: dbSet ( "INSERT INTO pystories_logs_login (name,serial,data) VALUES (?,?,NOW())" , string . format ( login .. "(" .. result [ 1 ]. id .. ")" ), getPlayerSerial ( client ))
else
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Podane dane s? nieprawid?owe." , "blad" )
end
else
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Podany login nie istnieje w bazie." , "blad" )
end
end )
local maks_ilosc_kont = 2 -- Maksymalna ilosc kont do rejestracji
addEvent ( "logging:newAccount" , true )
addEventHandler ( "logging:newAccount" , resourceRoot , function( login , pass )
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_users WHERE register_serial=?" , getPlayerSerial ( client ))
if result and #result >= maks_ilosc_kont then
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Na ten serial zostala utworzona maksymalna ilosc kont." , "blad" )
return end
local result = exports [ "pystories-db" ]: dbGet ( "SELECT * FROM pystories_users WHERE login=?" , login )
if result and #result > 0 then
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Podany login ju? istnieje w bazie." , "blad" )
else
local query = exports [ "pystories-db" ]: dbSet ( "INSERT INTO pystories_users (login,pass,register_serial,changedpw) VALUES (?,?,?,?)" , login , teaEncode ( pass , "wypierdalacchuje" ), getPlayerSerial ( client ), 1 )
if query then
triggerClientEvent ( client , "logging:result" , resourceRoot , false , "Pomyslnie zarejestrowales(as) sie!" , "git" )
setElementData ( client , "player:logged" , true )
end
end
end )
nagrody ={
[ 1 ]=function( plr )
triggerClientEvent ( client , "iyw_notifications:send" , client , "info" , "To twoj pierwszy dzien kiedy jestes u nas pod rzad! Niedlugo otrzymasz na nagrode" )
end ,
[ 2 ]=function( plr )
triggerClientEvent ( client , "iyw_notifications:send" , client , "info" , "To tw?j drugi dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 500PLN!" )
plr : giveMoney ( 500 )
end ,
[ 3 ]=function( plr )
triggerClientEvent ( client , "iyw_notifications:send" , client , "info" , "To tw?j trzeci dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 600PLN!" )
plr : giveMoney ( 600 )
end ,
[ 4 ]=function( plr )
triggerClientEvent ( client , "iyw_notifications:send" , client , "info" , "To tw?j czwarty dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 750PLN!" )
plr : giveMoney ( 750 )
end ,
[ 5 ]=function( plr )
triggerClientEvent ( client , "iyw_notifications:send" , client , "info" , "To tw?j pi?ty dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 900PLN!" )
plr : giveMoney ( 900 )
end ,
[ 6 ]=function( plr )
triggerClientEvent ( client , "iyw_notifications:send" , client , "info" , "To tw?j sz?sty dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 1000PLN!" )
plr : giveMoney ( 1000 )
end ,
[ 7 ]=function( plr )
triggerClientEvent ( client , "iyw_notifications:send" , client , "info" , "To tw?j si?dmy dzie? kiedy jeste? u nas pod rz?d! 1 punkt premium!" )
exports [ "pystories-db" ]: dbSet ( "update pystories_users set pp=pp+1 where id=? limit 1" , plr : getData ( "player:sid" ))
end ,
}
[ Dodano : 2019-01-09, 22:11 ]
Nie nie dostaj?, ?adnego komunikatu.
Wysłany: 2019-01-10, 02:12
Loop
Inspektor
Wiek: 27 Na forum: 4289 dni Posty: 311
Nick w MP: Inspektor
Piwa : 201
Masz chocia? gdzie? w kodzie t? funkcje findPlayer?
Wysłany: 2019-01-10, 08:46
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
warunek if not ( getElementData ( plr , "player:logged" ) == true ) then return end sie nie spelnia, podaj db3
Wysłany: 2019-01-10, 16:35
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
w DB3 Czy?ciutkie nawet jak /pm pisze
Wysłany: 2019-01-10, 20:17
Loop
Inspektor
Wiek: 27 Na forum: 4289 dni Posty: 311
Nick w MP: Inspektor
Piwa : 201
Nigdzie ci nie nadajesz element daty "player:logged" przy logowaniu tylko przy rejestracji. Musisz nada? element date "player:logged" przy zalogowaniu na konto.
setElementData ( client , "player:logged" , true )
Wysłany: 2019-01-10, 21:05
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Okey dzi?kuje za pomoc <3 ! Mo?na zamkn?? temat.
Tagi: nie :: można :: pisać
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: