- 
                Posts2,753
- 
                Joined
- 
                Last visited
- 
                Days Won18
Everything posted by Captain Cody
- 
	The issue I am having is that the object limits are far to low, causing terrible view distance in heavily populated areas and lag for some people due to SA constantly loading and unloading the models. Also the world bounds limits would be awesome to have extended because it would allow me to actually place my map off shore of SA instead of placing it in another dimension and having it warp players to and from. Summed up I'd need this for - - LOD limits - General object limits - Map bounds limits
- 
	Try running the server without any resources running and see what happens.
- 
	Found that function, wasn't exactly what I needed because I'm using move object, but after mathing for a couple of hours I finally got it.
- 
	How would I get the angle between two x,y,z offsets? I'm working on a custom train track system for the map I am working on, and need to make the train point at the location it is heading. Meaning I need to get the rotation offsets between the train position and the track position.
- 
	  [WIP] CSWP - Community Shader & Weather Pack (OpenSource)Captain Cody replied to Sam@ke's topic in Resources Nice year bump.
- 
	Oh sorry I thought you were speaking of the shaders; for the parts yes custom variants may be the case.
- 
	No they are not.
- 
	Use the ones that come from in game to make them functional.
- 
	Please explain the issue better.
- 
	minutesPlayed is not defined in your sql.
- 
	Try just setting your max slots in the server config to something really high like 500, then setting it in game lower; and slowly increase it with this.
- 
	Max players is not something that are able to change through that.
- 
	Try this. addEvent("kaydet:aclikvesusuzluk", true) function veriKaydetAclikveSusuzluk(client) local hunger = getElementData(client, "hunger") local thirst = getElementData(client, "thirst") local id = getElementData(client, "dbid") -- account:character:id if id then --exports.mysql:query_free("UPDATE `characters` SET `hunger`='"..hunger.."', `thirst`='"..thirst.."' WHERE `id`='"..id.."' ") -- Buda Çalisiyor exports.mysql:query_free("UPDATE `characters` SET `hunger`='"..hunger.."' WHERE `id`='"..id.."' ") exports.mysql:query_free("UPDATE `characters` SET `thirst`='"..thirst.."' WHERE `id`='"..id.."' ") end end addEventHandler ("kaydet:aclikvesusuzluk",getRootElement(), veriKaydetAclikveSusuzluk) addEvent("kaydet:dakikavesaat", true) function veriKaydetDakikaveSaat(client) local minutesplayed = getElementData(client, "minutesPlayed") or 0 local hoursplayed = getElementData(client, "hoursplayed") or minutesplayed/60 local id = getElementData(client, "dbid") -- account:character:id if id then exports.mysql:query_free("UPDATE `characters` SET `minutesPlayed`='"..minutesplayed.."' WHERE `id`='"..id.."' ") exports.mysql:query_free("UPDATE `characters` SET `hoursplayed`='"..hoursplayed.."' WHERE `id`='"..id.."' ") end end addEventHandler("kaydet:dakikavesaat",getRootElement(), veriKaydetDakikaveSaat) addEvent("kaydet:seviyevesaat", true) function veriKaydetSeviyeveAmac(client) local level = getElementData(client, "level") local hoursaim = getElementData(client, "hoursaim") local id = getElementData(client, "dbid") -- account:character:id if id then exports.mysql:query_free("UPDATE `characters` SET `level`='"..level.."' WHERE `id`='"..id.."' ") exports.mysql:query_free("UPDATE `characters` SET `hoursaim`='"..hoursaim.."' WHERE `id`='"..id.."' ") end end addEventHandler("kaydet:seviyevesaat",getRootElement(), veriKaydetSeviyeveAmac) -- knk bunu rar yap atman lazim yoksa olmaz bende addEvent("kaydet:alkol", true) function veriKaydetAlkol(client) local drunklevel = getElementData(client, "mydrunkLevel") local id = getElementData(client, "dbid") -- account:character:id if id then exports.mysql:query_free("UPDATE `characters` SET `drunkLevel`='"..drunklevel.."' WHERE `id`='"..id.."' ") end end addEventHandler("kaydet:alkol",getRootElement(), veriKaydetAlkol) --[[ addEvent("kaydet:yorgunluk", true) function veriKaydetYorgunluk() local stamina = getElementData(client, "stamina") local id = getElementData(client, "dbid") -- account:character:id if id then exports.mysql:query_free("UPDATE `characters` SET `stamina`='"..stamina.."' WHERE `id`='"..id.."' ") end end addEventHandler("kaydet:yorgunluk",getRootElement(), veriKaydetYorgunluk) ]] --[[ -- Old AFK Checker function checkAFKPlayers() if (tonumber(getElementData(client, "loggedin")) == 1) then for index, thePlayer in ipairs(getElementsByType("player")) do -- Loop all online players --if (getPlayerIdleTime(thePlayer) > 500000) then --outputChatBox("Uzun süredir hareketsizlik algilandi, 1 dakika sonra oyundan çikartilacaksiniz!", thePlayer, 255,0,0) --outputChatBox("Bu durumu iptal etmek için lütfen hareket edin!", thePlayer, 255,0,0) --end local poljailed = getElementData(thePlayer, "pd.jailtimer") local admjailed = getElementData(thePlayer, "adminjailed") local newjailed = getElementData(thePlayer, "jailed") outputChatBox("Bu mesaj eklenti deneme mesajidir, görünüyosa sistem çalismaktadir.", thePlayer, 255, 194, 14) if (getPlayerIdleTime(thePlayer) > 600000) and not exports.integration:isPlayerTrialAdmin(thePlayer) or exports.integration:isPlayerSupporter(thePlayer) or poljailed or admjailed or newjailed then -- Player hasn't moved for 300,000ms (5 minutes) kickPlayer(thePlayer, "AFK Oldugunuz Belirlendi, Oyundan Çikartildiniz!") -- Kick the idle player end end end end setTimer(checkAFKPlayers, 60000, 0)]] -- Stamina Functions addEvent("tiredAnimation",true) addEventHandler("tiredAnimation",root,function(target) setPedAnimation ( target, "FAT", "IDLE_tired", -1, true, false ) setElementData(target, "tired", true) setTimer(triggerEvent, 3000, 1, "switchToNormal", root, target ) end) addEvent("switchToNormal",true) addEventHandler("switchToNormal",root,function(target) setPedAnimation ( target, "ped", "IDLE_tired", 200 ) setElementData(target, "tired", false) setPedAnimation(target,false) --triggerClientEvent(target, "sayInformation", root, "en", "You can go now.") end) -- Anti-AFK System From Community (Al3grab), Edited : Almas ----------- CHANGEABLE AFK_TIME = 9 -- Dakika olarak uyari gelecek süre ( Eger her 5 dakikada 1 uyari gelmesi için burayi 5 Yap) AFK_TIMES = 1 -- Kaç tane 9 dakika geçince atilacagi (Bunu 2 yaparsan 9 dakika afk kalinca uyari 18. dakikada kick gelir) SHOW,AFK_MSG = true -- Oyuncunu ekraninda afk bildirimi msgs = true -- Oyundan atilinca gelen mesajlar ----------- function onResourceStart() -- outputDebugString("Anti-AFK Sistemi | Aktif") -- startCheck() end addEventHandler("onResourceStart",resourceRoot,onResourceStart) function startCheck() checkTimer = setTimer ( function() for i,m in ipairs ( getElementsByType("player") ) do if (tonumber(getElementData(m, "loggedin")) == 1) then local idle = getPlayerIdleTime(m) if tonumber(idle) >= AFK_TIME * 60 * 1000 then local poljailed = getElementData(m, "pd.jailtimer") local admjailed = getElementData(m, "adminjailed") local newjailed = getElementData(m, "jailed") --if exports.integration:isPlayerTrialAdmin(m) or exports.integration:isPlayerSupporter(m) or poljailed or admjailed or newjailed then if exports.global:isStaffOnDuty(m) or poljailed or admjailed or newjailed then setPlayerAfk(m,false) showAfkMessage(m,false) return true end if not isPlayerAfk(m) then -- the player is afk triggerEvent("onPlayerAfk",m,m,idle) end else local afk = isPlayerAfk(m) if ( afk == true ) then -- the player was afk and now he is back ! triggerEvent("onPlayerAfkBack",m,m) end end end end end, 1000 , 0 ) end addEvent("onPlayerAfk",true) addEventHandler("onPlayerAfk",root,function ( Player , Time ) ------ if SHOW then if ( tostring ( AFK_MSG ) ) then showAfkMessage(Player,true) end end ------ setPlayerAfk(Player,true) ------ end ) addEvent("onPlayerAfkBack",true) addEventHandler("onPlayerAfkBack",root,function ( Player ) setPlayerAfk(source,false) ------ showAfkMessage(source,false) ------ end ) function isPlayerAfk(Player) local afk = getElementData(Player,"State-AFK") or false return afk end function setPlayerAfk(Player,state) setElementData(Player,"State-AFK",state or false) end function showAfkMessage(Player,state) if state == true then ev = "YouAreAFK" else ev = "YouAreNotAFK" end triggerClientEvent(Player,tostring(ev) or "YouAreAFK",Player) end function onAfkEnd(Player) Player = Player or source -- setElementData(Player,"AFKtime",getElementData(Player,"AFKtime") + 1 ) local afkTimes = getElementData(Player,"AFKtime") if ( afkTimes and afkTimes >= AFK_TIMES ) then kickPlayer(Player,"Uzun süredir oyun ile ilgilenmediginizden sunucudan atildiniz! ("..tonumber(AFK_TIME).." Dakika)") if msgs then outputChatBox("** #FFFF00"..getPlayerName(Player).."#FFFF00 uzun süre oyunla ilgilenmediginden sunucudan çikartildi! ["..afkTimes.."]",root,255,0,0,true) end else --killPed(Player) if msgs then outputChatBox("** Uzun süredir oyunla ilgilenmediginiz anlasildi, devam edersiniz oyundan çikartilacaksiniz! ["..afkTimes.."/2]",Player,255,0,0,true) end end end addEvent("KillAFK",true) addEventHandler("KillAFK",root,onAfkEnd) -- Üst Arama function friskPlayer(thePlayer, commandName, targetPlayer) if not (targetPlayer) then outputChatBox("SYNTAX: /" .. commandName .. " [Oyuncu Ad/ID]", thePlayer, 255, 194, 14) else local username = getPlayerName(thePlayer) local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, targetPlayer) if targetPlayer then if targetPlayer == thePlayer then outputChatBox("[#ccff00!#cc0000]#ffffff Bu eylemi kendinize uygulayamazsiniz!", thePlayer, 155, 0, 0, true) return end if not getElementData(thePlayer, "friskplayer") == true then local x, y, z = getElementPosition(thePlayer) local tx, ty, tz = getElementPosition(targetPlayer) local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz) local theVehicle = getPedOccupiedVehicle(thePlayer) local theVehicleT = getPedOccupiedVehicle(targetPlayer) if not theVehicle and not theVehicleT then if distance < 3 then outputChatBox("[#ccff00!#cc0000]#ffffff "..getPlayerName(targetPlayer):gsub("_", " ").." oyuncusuna üst arama istegi bildirildi!", thePlayer, 155, 0, 0, true) outputChatBox("[#ccff00!#cc0000]#ffffff "..getPlayerName(thePlayer):gsub("_", " ").." üstünüzü aramak istiyor,", targetPlayer, 155, 0, 0, true) outputChatBox("[#ccff00!#cc0000]#ffffff '/ukabul' ve ya '/ured' komutlari ile istegi yanitlayabilirsiniz!", targetPlayer, 155, 0, 0, true) setElementData(targetPlayer, "friskRequest", thePlayer) else outputChatBox("[#ccff00!#cc0000]#ffffff "..getPlayerName(targetPlayer):gsub("_", " ").." oyuncusunun üstünü aramak için yaninda olmalisiniz!", thePlayer, 155, 0, 0, true) end else outputChatBox("[#ccff00!#cc0000]#ffffff Araçta iken birisinin üstünü arayamazsiniz!", thePlayer, 155, 0, 0, true) end else outputChatBox("[#ccff00!#cc0000]#ffffff Zaten birisinin üzerini ariyorsunuz!", thePlayer, 155, 0, 0, true) end end end end addCommandHandler("uara", friskPlayer) function acceptFrisk(thePlayer) local requestPlayer = getElementData(thePlayer, "friskRequest") if requestPlayer then local x, y, z = getElementPosition(thePlayer) local tx, ty, tz = getElementPosition(requestPlayer) local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz) if distance < 3 then triggerEvent("allowFrisk", thePlayer, requestPlayer, thePlayer) setElementData(thePlayer, "friskRequest", nil) outputChatBox("[#ccff00!#cc0000]#ffffff "..getPlayerName(thePlayer):gsub("_", " ").." oyuncusundan gelen üst arama istegini kabul ettiniz!", thePlayer, 155, 0, 0, true) outputChatBox("[#ccff00!#cc0000]#ffffff "..getPlayerName(requestPlayer):gsub("_", " ").." oyuncusu üst arama isteginizi kabul etti!", requestPlayer, 155, 0, 0, true) else outputChatBox("[#ccff00!#cc0000]#ffffff "..getPlayerName(requestPlayer):gsub("_", " ").." oyuncusundan çok uzaktasiniz!", thePlayer, 155, 0, 0, true) setElementData(thePlayer, "friskRequest", nil) end end end addCommandHandler("ukabul", acceptFrisk) function denyFrisk(thePlayer) local requestPlayer = getElementData(thePlayer, "friskRequest") if requestPlayer then outputChatBox("[#ccff00!#cc0000]#ffffff "..getPlayerName(thePlayer):gsub("_", " ").." oyuncusu üst arama isteginizi reddetti!", requestPlayer, 155, 0, 0, true) outputChatBox("[#ccff00!#cc0000]#ffffff "..getPlayerName(requestPlayer):gsub("_", " ").." oyuncusundan gelen üst arama istegini reddettiniz!", thePlayer, 155, 0, 0, true) setElementData(thePlayer, "friskRequest", nil) end end addCommandHandler("ured", denyFrisk) function allowFrisk(thePlayer) triggerEvent("friskShowItems", thePlayer, source, source) --triggerClientEvent(source, "friskShowItems", player, items) --triggerEvent("subscribeToInventoryChanges",source,player) --triggerClientEvent(source,"showInventory",source,player) end addEvent("allowFrisk", true) addEventHandler("allowFrisk", getRootElement(), allowFrisk) function giveHBonus() local pbonus = 200 if (getElementData(source, "loggedin") == 1) then exports.global:giveMoney(source, pbonus) outputChatBox("[#ccff00!#cc0000]#ffffff Tebrikler, yeni saatlik bonus aldiniz! (200$)", source, 155, 0, 0, true) end end addEvent("level:bonusver", true) addEventHandler("level:bonusver", getRootElement(), giveHBonus) Also make sure to define the elementData "minutesPlayed" somewhere.
- 
	I'm tired forgive me.
- 
	Please tell which line is giving the issue; and put it in proper lua format.
- 
	It's not open to the public yet due to it still being worked on ; but I would highly recommend you join Heretrics when it's ready.
- 
	max = 5 function setTeamPolice(player) local police = getTeamFromName("police") if #getPlayersInTeam(police) < max+1 then setPlayerTeam(player,police) end end addCommandHandler("police",setTeamPolice)
- 
	Looks nice.
- 
	I was wondering at first if that was the case. And now that I look the vehicles lack dirt; meaning that is indeed what they did.
- 
	---------------------------------------------------------------------------------------------------------------------

 
            
        