Jump to content

illestiraqi

Members
  • Posts

    256
  • Joined

  • Last visited

Everything posted by illestiraqi

  1. I've added another group and now it automatically brings me to NFS Team now and I have the ~UpS~ tag... Server: ---------------do not change or touch this---------- Names={} Tags={} Colors={} ACL={} -------------------------------------------------------------- ---------------------------here put your clans read readme for instructions--------------------------------------- local names ={"Guest Team","Ultra Pro Skills Staff","|High Class|","NFS Team"} local tags ={"","~UpS~","|HC|","[NFS]"} local colors ={"#e6e6e6","#ff6600","#32ffcc","#cc0000"} local acls ={"none","none","none","none"} -------- load------------ function loadTeams() for i,name in pairs(names) do Names[i]=name end for i,tag in pairs(tags) do Tags[i]=tag end for i,color in pairs(colors) do Colors[i] = color end for i,acl in pairs(acls) do ACL[i] = acl end end addEventHandler("onResourceStart",getRootElement(),loadTeams) --------------------------------------------------- ----- move on start------------------ function moveOnStart() for i,player in pairs(getElementsByType("player")) do check(player) end end addEventHandler("onResourceStart",getRootElement(),moveOnStart) ------------------------------------------------------------------------- -----------check---------------------------- function check (player) setPlayerTeam(player,nil) for i,tag in pairs(tags) do if string.find(getPlayerName(player),tag) then local account=getPlayerAccount(player) if ACL[i]~="none" and not isObjectInACLGroup ( "user." ..getAccountName(account) , aclGetGroup ( ACL[i] ) ) then return end local name = Names[i] local color = Colors[i] if not getTeamFromName(name) then createTeam(name,getColorFromString(color)) end local team = getTeamFromName(name) setPlayerTeam(player,team) end end end -------------------------------- ----------remove Empty Team ---------- function remove() for t,teams in pairs(names) do local team = getTeamFromName(teams) if team then if countPlayersInTeam ( team )==0 then destroyElement(team) end end end end ----------------------------------------------------- -------NickChange------------- function nick(old,new) setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerChangeNick",getRootElement(),nick) --------------------------------------------- -------Join-------------------------------- function join() setTimer(check,4000,1,source) end addEventHandler("onPlayerJoin",getRootElement(),join) ------------------------------- ---------Quit--------------------- function quit(player) setTimer(remove,1000,1) end addEventHandler("onPlayerQuit",getRootElement(),quit) ------------------------------------ ---------Login--------------------- function login() setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerLogin",getRootElement(),login) ------------------------------------ ---------Logout--------------------- function logout() setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerLogout",getRootElement(),logout) ------------------------------------ ----------blip-------------- function blip(player) local team = getPlayerTeam(player) if team then for v,blip in pairs(getAttachedElements(player)) do if getElementType(blip)=="blip" then local r,g,b =getTeamColor(team) setBlipColor(blip,r,g,b,255) setVehicleColor ( blip,r,g,b) end end end end function timer() setTimer(blip,3000,1,source) end addEventHandler("onPlayerSpawn",getRootElement(),timer) addEvent ( 'onPlayerPickUpRacePickup', true ) function zaa ( id, type, model ) if ( getPlayerTeam ( source ) ) then if ( eventName == 'onPlayerPickUpRacePickup' and id == 'vehiclechange' or id == 'repair' or id == 'nitro' ) then local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ); else local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ) end end end addEventHandler ( 'onPlayerVehicleEnter', root, zaa ) addEventHandler ( 'onPlayerPickUpRacePickup', root, zaa )
  2. Wait... on line 2 do i have to change class.name? EDIT: Guess not I changed it back to class.name and works Thank you
  3. hmm weird I put my friend in the Police ACL team and I tried it and let me access...
  4. In this script https://community.multitheftauto.com/index.php?p= ... ls&id=6756 it brings player in team only if user has the tag but heres what i've done. Problem is the other teams I made "|HQ|" (High Class) wouldn't work only Guest and the Admin (UpS) anyone know how to fix? Server ---------------do not change or touch this---------- Names={} Tags={} Colors={} ACL={} -------------------------------------------------------------- ---------------------------here put your clans read readme for instructions--------------------------------------- local names ={"Guest Team","Ultra Pro Skills Staff","|High Class|} local tags ={"","~UpS~","|HC|} local colors ={"#e6e6e6","#ff6600","#32ffcc"} local acls ={"none","none","none"} -------- load------------ function loadTeams() for i,name in pairs(names) do Names[i]=name end for i,tag in pairs(tags) do Tags[i]=tag end for i,color in pairs(colors) do Colors[i] = color end for i,acl in pairs(acls) do ACL[i] = acl end end addEventHandler("onResourceStart",getRootElement(),loadTeams) --------------------------------------------------- ----- move on start------------------ function moveOnStart() for i,player in pairs(getElementsByType("player")) do check(player) end end addEventHandler("onResourceStart",getRootElement(),moveOnStart) ------------------------------------------------------------------------- -----------check---------------------------- function check (player) setPlayerTeam(player,nil) for i,tag in pairs(tags) do if string.find(getPlayerName(player),tag) then local account=getPlayerAccount(player) if ACL[i]~="none" and not isObjectInACLGroup ( "user." ..getAccountName(account) , aclGetGroup ( ACL[i] ) ) then return end local name = Names[i] local color = Colors[i] if not getTeamFromName(name) then createTeam(name,getColorFromString(color)) end local team = getTeamFromName(name) setPlayerTeam(player,team) end end end -------------------------------- ----------remove Empty Team ---------- function remove() for t,teams in pairs(names) do local team = getTeamFromName(teams) if team then if countPlayersInTeam ( team )==0 then destroyElement(team) end end end end ----------------------------------------------------- -------NickChange------------- function nick(old,new) setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerChangeNick",getRootElement(),nick) --------------------------------------------- -------Join-------------------------------- function join() setTimer(check,4000,1,source) end addEventHandler("onPlayerJoin",getRootElement(),join) ------------------------------- ---------Quit--------------------- function quit(player) setTimer(remove,1000,1) end addEventHandler("onPlayerQuit",getRootElement(),quit) ------------------------------------ ---------Login--------------------- function login() setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerLogin",getRootElement(),login) ------------------------------------ ---------Logout--------------------- function logout() setTimer(check,1000,1,source) setTimer(remove,1500,1) end addEventHandler("onPlayerLogout",getRootElement(),logout) ------------------------------------ ----------blip-------------- function blip(player) local team = getPlayerTeam(player) if team then for v,blip in pairs(getAttachedElements(player)) do if getElementType(blip)=="blip" then local r,g,b =getTeamColor(team) setBlipColor(blip,r,g,b,255) setVehicleColor ( blip,r,g,b) end end end end function timer() setTimer(blip,3000,1,source) end addEventHandler("onPlayerSpawn",getRootElement(),timer) addEvent ( 'onPlayerPickUpRacePickup', true ) function zaa ( id, type, model ) if ( getPlayerTeam ( source ) ) then if ( eventName == 'onPlayerPickUpRacePickup' and id == 'vehiclechange' or id == 'repair' or id == 'nitro' ) then local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ); else local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ) end end end addEventHandler ( 'onPlayerVehicleEnter', root, zaa ) addEventHandler ( 'onPlayerPickUpRacePickup', root, zaa )
  5. illestiraqi

    asdasd

    lol? Are those the only ones you made? If not can you PM Me the others because these are useful and I bet the others would be too.
  6. In this post here... I'm trying to say where it shows class.name is that where i put the name of the team I want ACL connect? EDIT: Here is my s_main.lua g_root = getRootElement( ); classGroups = { }; addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, function( categoryIndex, classIndex, skinIndex, password ) if skinIndex then local class = classGroups[ categoryIndex ].classes[ classIndex ]; if class.password then if not password or password == "" then triggerClientEvent( client, "spawn_requestPassword", root, class.name ); return; elseif password ~= class.password then outputChatBox( "The password you typed in is incorrect! Try again or cancel to choose different class.", client, 200, 50, 50 ); triggerClientEvent( client, "spawn_requestPassword", root, class.name ); return; end end -- make new line (21) in s_main.lua local classACL = aclGetGroup( Police ); local plrAccount = getPlayerAccount( client ); if ( classACL and ( not isGuestAccount( plrAccount ) ) or ( not isObjectInACLGroup( "user." .. getAccountName( plrAccount ), classACL ) ) ) then outputChatBox( "You are not member of this team/gang. Please, choose different team!", client, 200, 50, 50 ); requestMenu( client ); return; end local skin = class.skinMngr.skins[ skinIndex ]; local spawn = true; local spawned; --[[if not classGroups[ cetegoryIndex ].owner then -- if there is NO owner of the clan/gang spawn player spawn = true; else -- if there IS owner of the clan/gang then check if he's member of the clan/gang end]] if spawn then if not class.team then class.team = createTeam( class.name, class.color.red, class.color.green, class.color.blue ); end local plrTeam = getPlayerTeam( client ); if ( ( plrTeam ) and ( plrTeam ~= class.team ) and ( countPlayersInTeam( plrTeam ) == 1 ) ) then destroyElement( plrTeam ); end spawned = spawnPlayer( client, skin.spawnLoc.x, skin.spawnLoc.y, skin.spawnLoc.z, skin.spawnLoc.rot, skin.modelId, 0, 0, class.team ); end if spawned then setElementData( client, "team", class.name ) setElementData( client, "skin", skin.name ) fadeCamera( client, true ); setCameraTarget( client, client ); setTimer( setCameraTarget, 200, 1, client, client ); triggerClientEvent( client, "spawn_SpawnedSuccessfully", client ); --setPlayerMoney( client, 500 ); for _, weapon in ipairs( class.weaponMngr.weapons ) do giveWeapon( client, weapon.id, weapon.ammo, false ); end createBlipAttachedTo( client, 0, 2, class.color.red, class.color.green, class.color.blue ) else triggerClientEvent( client, "spawn_FailedToSpawn", client ); if countPlayersInTeam( class.team ) == 0 then destroyElement( class.team ); class.team = nil; end end end end ); addEvent( "spawn_receivePassword", true ); addEventHandler( "spawn_receivePassword", g_root, function( ) end ); addEventHandler( "onPlayerSpawn", g_root, function ( ) end ); addEventHandler( "onPlayerWasted", g_root, function( ) fadeCamera( source, false, 4 ); setTimer( requestMenu, 5000, 1, source ); deleteAllPlayerBlips( source ) end ); function requestMenu( player ) callClientFunc( player, "showSpawnMenu", true, true ); callClientFunc( player, "classSelected" ); end addCommandHandler( "kill", function( plr ) killPed( plr ); end ) function preloadClassesInfo( ) local groups = getElementsByType( "category" ); for _, group in ipairs( groups ) do table.insert( classGroups, Group:New( group ) ); end end addEventHandler( "onResourceStart", getResourceRootElement(), preloadClassesInfo ) function deleteAllPlayerBlips(player) local elements = getAttachedElements(player) if (elements) then for i, element in ipairs(elements) do if (getElementType(element) == "blip") then destroyElement(element) end end end print( "number of players in team: " .. tostring( countPlayersInTeam( getPlayerTeam( player ) ) ) ); end addEventHandler( "onPlayerQuit", g_root, function() deleteAllPlayerBlips(source) end ); ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ function callClientFunc( player, funcName, ... ) if #{ ... } ~= 0 then triggerClientEvent( player, "_clientCallFunction", root, funcName, ... ) else triggerClientEvent( player, "_clientCallFunction", root, funcName ) end end addEvent( "_serverCallFunction", true ) addEventHandler( "_serverCallFunction", root, function( funcName, ... ) _G[ funcName ](...) end ) Now when I try joining Police team it says "You are not member of this team/gang. Please, choose different team!" and I am in the Police ACL team... also when I try joining different teams it still says "You are not member of this team/gang. Please, choose different team!" even if its not ACL...
  7. If someone please help me with a blip script, in the LS gunshop near Hospital and Police station please put a gun blip there and it will show in F11 map always and only show in mini radar if there 50 meters near it.
  8. For this jail script I want the animation removed like when they are placed in jail it should not give them the animation. Server: --***********************************-- --***********************************-- -- Jail System -- -- By Al3grab -- -- Server Side -- --***********************************-- --***********************************-- Command = get("command") -- getTheCommand rRoot = getResourceRootElement(getThisResource()) ------ function getData(to) local file = xmlLoadFile("data.xml") jTable = {} tTable = {} if file then for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"Jails",0)))do local name = xmlNodeGetAttribute(v,"name") local posX,posY,posZ = xmlNodeGetAttribute(v,"posX"),xmlNodeGetAttribute(v,"posY"),xmlNodeGetAttribute(v,"posZ") local int = xmlNodeGetAttribute(v,"int") local dim = xmlNodeGetAttribute(v,"dim") table.insert(jTable, {name,posX,posY,posZ,int,dim}) end for k,v in ipairs (xmlNodeGetChildren(xmlFindChild(file,"time",0)))do local times = xmlNodeGetAttribute(v,"times") for i =1,50 do local iTime = gettok ( times, i, string.byte(',') ) if iTime then -- if tonumber(iTime) > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Minutes" if iTime > 59.5 then iTime = math.floor(iTime / 60) iTimeDes = "Hours" end else iTimeDes = "Seconds" end table.insert(tTable,{iTime,iTimeDes}) end end end end triggerClientEvent(to,"sendDataz",to,jTable,tTable) -- sending to client event end addEvent("getDataz",true) addEventHandler("getDataz",root,getData) addCommandHandler ( Command, -- Adding The Command Handler function ( player, cmd ) if hasObjectPermissionTo ( player, "function.banPlayer" ) then triggerClientEvent(player,"jailShow",player) else outputChatBox(" Access Denied ",player,255,0,0) end end ) anims = { "F_smklean_loop", "M_smklean_loop", "M_smkstnd_loop", "M_smk_drag", "M_smk_in", "M_smk_loop", "M_smk_out", "M_smk_tap" , } function removeVehicle(thePlayer) if isPedInVehicle(thePlayer) then destroyElement(getPedOccupiedVehicle(thePlayer)) end end function JailHim(jailed,theJails,time,timeDes,showWho,timeReady) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end removePedFromVehicle(thePlayer) for k,v in ipairs ( jTable ) do if theJails == v[1] then theJail = v end end if theJail then if tostring(time) then if timeReady == true then theTimex = tonumber(time) else theTimex = gettok ( time, 1, string.byte(timeDes) ) end if timeDes == "Hours" then theTimex = math.floor(theTimex*60*60*1000) elseif timeDes == "Minutes" then theTimex = math.floor(theTimex*60*1000) elseif timeDes == "Seconds" then theTimex = math.floor(theTimex*1000) end startJailTimer ( thePlayer , theTimex ) local x,y,z = theJail[2],theJail[3],theJail[4] local int = theJail[5] local dim = theJail[6] setElementInterior ( thePlayer, int ) setElementDimension ( thePlayer, dim ) setElementPosition (thePlayer,x,y,z ) setElementData(thePlayer,"jailed",true) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",true) toggleControl(thePlayer,"fire",false) if showWho ~= true then outputChatBox("** #FFFF00You Jailed [ "..getPlayerName(thePlayer).." #FFFF00] at "..theJail[1].." For "..time,source,255,0,0,true) outputChatBox("** #FFFF00You Have Been Jailed By [ "..getPlayerName(source).." #FFFF00] at "..theJail[1].." For "..time,thePlayer,255,0,0,true) end outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00] Has Been Jailed For "..time,root,255,0,0,true) local randomAnim setPedAnimation(thePlayer,"SMOKING",anims[math.random(#anims)],theTimex/2) else outputChatBox("** #FFFF00Please Select Time !",source,255,0,0,true) end else outputChatBox("** #FFFF00Please Select a Jail !",source,255,0,0,true) end end addEvent("JailHimx",true) addEventHandler("JailHimx",root,JailHim) function unJailHim(jailed,showWho) thePlayer = getPlayerFromName(jailed) if not thePlayer then outputChatBox("** #FFFF00Please Select a Player !",source,255,0,0,true) return end --if getElementData(thePlayer,"jailed") == true then setElementInterior ( thePlayer, 0) setElementDimension ( thePlayer, 0 ) setElementPosition ( thePlayer, 1552.9108886719, -1675.5844726563, 16.1953125) setElementData(thePlayer,"jailed",false) setElementData(rRoot,""..getPlayerSerial(thePlayer).."-j",false) if showWho ~= true then outputChatBox("** #FFFF00You Released [ "..getPlayerName(thePlayer).." #FFFF00]",source,255,0,0,true) outputChatBox("** #FFFF00You Have Been Released by [ "..getPlayerName(source).." #FFFF00]",thePlayer,255,0,0,true) end outputChatBox("** #FFFF00[ "..getPlayerName(thePlayer).." #FFFF00] Has Been Released ",root,255,0,0,true) setPedAnimation(thePlayer) stopJailTimer(Player) toggleControl(thePlayer,"fire",true) -- setTimer(killPed,1500,1,thePlayer) --else -- outputChatBox("The Player is Not Jailed !",source,255,0,0,true) --end end addEvent("unJailHim",true)-- unJail addEventHandler("unJailHim",root,unJailHim) addEvent("onJailEnd",true) addEventHandler("onJailEnd",root,function(player) unJailHim(getPlayerName(player),true) end ) addEventHandler("onPlayerSpawn",root, -- Check If He Is Jailed [ OnSpawn ] function() if getElementData(source,"jailed") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) end end end) addEventHandler("onPlayerJoin",root, -- Check If He Is Jailed - By Serial [ OnJoin ] function() if getElementData(rRoot,""..getPlayerSerial(source).."-j") == true then randomJail = jTable[math.random(#jTable)] if randomJail then x,y,z = randomJail[2],randomJail[3],randomJail[4] int = randomJail[5] dim = randomJail[6] setElementInterior ( source, int ) setElementDimension(source,dim) setElementPosition (source,x,y,z ) -- time = getElementData(rRoot,""..getPlayerSerial(source).."-t",time) or 5 * 1000 startJailTimer(source,time) setElementData(source,"jailed",true) end end end ) ---- function startJailTimer(Player,theTime) -- to start mission timer .. if Player then TimerDisplay = textCreateDisplay() m,s,cs = msToTimeStr(theTime) fullTime = m..":"..s TimerText = textCreateTextItem ( "Time Left : "..tostring(fullTime).."", 0.39, 0.7 ,"medium",0,255,0,255,2.0,"left","center",255) textDisplayAddText ( TimerDisplay, TimerText ) textDisplayAddObserver ( TimerDisplay, Player ) sortTimerShit(Player,TimerText,theTime) end end --Robbed from JailTimerr resource , and it was robbed from arc_ function msToTimeStr(ms) if not ms then return '' end if ms < 0 then return "0","00","00" end local centiseconds = tostring(math.floor(math.fmod(ms, 1000)/10)) if #centiseconds == 1 then centiseconds = '0' .. centiseconds end local s = math.floor(ms / 1000) local seconds = tostring(math.fmod(s, 60)) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring(math.floor(s / 60)) return minutes, seconds, centiseconds end function sortTimerShit(plr,timer,time) -- to sort timer's shit .. if timer and time then if isTimer(timerShitTimer) then killTimer(timerShitTimer) end timerShitTimer = setTimer(function(plr) time = time - 70 m,s,cs = msToTimeStr(time) fullTime = m..":"..s textItemSetText(timer,"Time Left : "..tostring(fullTime).."") if plr then setElementData(rRoot,""..getPlayerSerial(plr).."-t",time) end if ( tonumber(m) <= 0 and tonumber(s) <= 0 and tonumber(cs) <= 0 ) then onTimerFinish(plr,timer) end end , 50 , 0 ,plr ) end end function stopJailTimer(Player) textDestroyDisplay(TimerDisplay) if TimerText then
  9. My race scoreboard has disapeared and I can't find any backup's if any can please upload it somewhere and please give me link I need it
  10. I can host for a fair price.
  11. When I try it in-game in the console this is given: [01:46:31] ERROR: Client triggered serverside event spawn_clientRequestSpawn, but event is not added serverside Any idea why? Also when I try spawning as something else still give me same problem
  12. While Im adding the script in this script -- make new line (21) in s_main.lua local classACL = aclGetGroup( class.name ); local plrAccount = getPlayerAccount( client ); if ( classACL and ( not isGuestAccount( plrAccount ) ) or ( not isObjectInACLGroup( "user." .. getAccountName( plrAccount ), classACL ) ) ) then outputChatBox( "You are not member of this team/gang. Please, choose different team!", client, 200, 50, 50 ); requestMenu( client ); return; end I will have to ONLY change the | To the one I want acl permission? ( class.name ) and... isObjectInACLGroup( "user." Only user part correct?
  13. I want a login panel that fades the background and theres a login panel witch wont log the player in and wont let them see themselves ingame until logged in.
  14. Did I not just show proof of chat? Want actual screenie or him to post here?
  15. I did but he couldn't do it (Jack) Log in-game George: Can you try fixing it Cheese#: i tried it wont work Cheese = Jack
  16. My friend Jack and Nicholas made them for me. I got the meta and everything but this script radar isnt just even
  17. In the radar this is what happends Both of those are supposed to be together in the middle meaning in the picture thats fked and happends to me right now. I want all stuff in same position and same area. please help fix Client local sx,sy = guiGetScreenSize() local posx = sy * 0.05 local posy = sy * 0.725 local height = sy * 0.225 local centerleft = posx + height / 2 local centertop = posy + height / 2 local blipsize = height / 16 local lpsize = height / 8 local range = 180 local lp = getLocalPlayer() addEventHandler( "onClientResourceStart", getRootElement( ), function ( startedRes ) --outputChatBox( "#0099FFPress #FFFFFFF2 #0099FFto #FFFFFFdisable/enable #0099ffthe Radar Objects!",255,255,255,true) end ) function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end return t end function getDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle) local dx = math.cos(a) * dist local dy = math.sin(a) * dist return x+dx, y+dy end function getShadeObjectsInMyDistance () objectTable = {} local target = getCameraTarget() if target and getElementType(target) == "vehicle" then lp1 = getVehicleOccupant(target) else lp1 = getLocalPlayer() end local px, py, pz = getElementPosition(lp1) if not px then return end for id, object in ipairs(getElementsByType("object")) do local ex, ey, ez = getElementPosition(object) local dist = getDistanceBetweenPoints2D(px,py,ex,ey) if getElementModel(object) == 3458 or getElementModel(object) == 8558 or getElementModel(object) == 8838 or getElementModel(object) == 18449 or getElementModel(object) == 18450 or getElementModel(object) == 7657 then if dist < 180 then table.insert(objectTable,object) end end end return objectTable end local huntersonly = false setTimer( function() huntersonly = true for id, player in ipairs(getElementsByType("player")) do if getElementData(player, "state") == "alive" then if getPedOccupiedVehicle(player) and getElementModel(getPedOccupiedVehicle(player)) ~= 425 then huntersonly = false end end end local target = getCameraTarget() if target and getElementType(target) == "vehicle" then lp = getVehicleOccupant(target) else lp = getLocalPlayer() end end,1000,0) showObjects = false function disableObjects () showObjects = not showObjects if showObjects == false then end end rotationRotator = 0 addEventHandler("onClientRender", getRootElement(), function() showPlayerHudComponent("radar", false) local px, py, pz = getElementPosition(lp) local pr = getPedRotation(lp) local cx,cy,_,tx,ty = getCameraMatrix() local north = findRotation(cx,cy,tx,ty) dxDrawImage(posx,posy,height,height, "radar/img/radar.png") dxDrawImage(posx,posy,height,height, "radar/img/north.png", north) --Health --local vehicle = getPedOccupiedVehicle(lp) --if vehicle then --local healthColor = getElementHealth(vehicle)/4 --local healthHeight = healthColor/250 --local health = getElementHealth(vehicle) --local health = math.max(health - 250, 0)/750 --local color = tocolor(255-healthColor,healthColor/1.5 ,0,255) --if healthColor < 40 then --local number = math.random(0,1) --if number == 1 then -- alpha = 255 --else -- alpha = 0 --end --color = tocolor(255-healthColor,healthColor/1.5 ,0,alpha) --end --dxDrawImage(posx-6,posy-4,height+8,height+8, "radar/img/healthbar.png",0,0,0,tocolor(255-healthColor,healthColor/1.5 ,0,255)) --end if showObjects == true then for id, object in ipairs(getShadeObjectsInMyDistance()) do local xx,yy,rot = getElementRotation(object) local ex, ey, ez = getElementPosition(object) local dist = getDistanceBetweenPoints2D(px,py,ex,ey) if dist > range then dist = tonumber(range) end local angle = 180-north + findRotation(px,py,ex,ey) local cblipx, cblipy = getDistanceRotation(0, 0, height*(dist/range)/2, angle) local blipsize2 = blipsize-8.2 local blipx = centerleft+cblipx-blipsize/2 local blipy = centertop+cblipy-blipsize2 local yoff = 0 local r,g,b,a = 255,255,255,255 local img = "" local x1 = 7 local x2 = 14 local y1 = 0 local y2 = 0 if getElementModel(object) == 8558 then img = "" elseif getElementModel(object) == 3458 then img = "" elseif getElementModel(object) == 18449 or getElementModel(object) == 18450 then img = "" blipsize2 = blipsize-2 blipy = centertop+cblipy-blipsize2 x1 = 15 x2 = 30 elseif getElementModel(object) == 8838 then img = "" elseif getElementModel(object) == 7657 then img = "" x1 = 5 x2 = 10 yy = 0 end if yy == 90 then x1 = -4 x2 = -8 end end end for id, player in ipairs(getElementsByType("player")) do local veh = getPedOccupiedVehicle(player) if getElementData(player, "state") == "alive" and veh and player ~= lp then local _,_,rot = getElementRotation(veh) local ex, ey, ez = getElementPosition(veh) local dist = getDistanceBetweenPoints2D(px,py,ex,ey) if dist > range then dist = tonumber(range) end local angle = 180-north + findRotation(px,py,ex,ey) local cblipx, cblipy = getDistanceRotation(0, 0, height*(dist/range)/2, angle) local blipx = centerleft+cblipx-blipsize/2 local blipy = centertop+cblipy-blipsize/2 local yoff = 0 local r,g,b,a = 255,255,255,255 if getPlayerTeam(player) then r,g,b = getTeamColor( getPlayerTeam(player) ) end local img = "radar/img/blip.png" if (ez - pz) >= 5 then img = "radar/img/blipup.png" elseif (ez - pz) <= -5 then img = "radar/img/blipdown.png" end if tonumber(getElementModel(veh)) == 425 then --r, g, b, a = 255, 0, 0, 200 img = "radar/img/hunter.png" end dxDrawImage(blipx, blipy, blipsize, blipsize, img, north-rot+45, 0, 0, tocolor(r,g,b,a)) if img == "radar/img/hunter.png" then rotationRotator = rotationRotator + 3 dxDrawImage(blipx, blipy, blipsize, blipsize, "radar/img/rotor.png", north-rot+45+rotationRotator, 0, 0) end end end dxDrawImage(centerleft - lpsize/2, centertop - lpsize/2, lpsize,lpsize, "radar/img/local.png", north-pr) end ) addEventHandler("onClientRender", getRootElement(), function() local screenWidth, screenHeight = guiGetScreenSize() end )
  18. Can you add that to the latest script done for me?
  19. Did I have to change something because the script just fked up
  20. g_root = getRootElement( ); classGroups = { }; addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, function( categoryIndex, classIndex, skinIndex, password ) if skinIndex then local class = classGroups[ categoryIndex ].classes[ classIndex ]; if class.password then if not password or password == "" then triggerClientEvent( client, "spawn_requestPassword", root, class.name ); return; elseif password ~= class.password then outputChatBox( "The password you typed in is incorrect! Try again or cancel to choose different class.", client, 200, 50, 50 ); triggerClientEvent( client, "spawn_requestPassword", root, class.name ); return; end end -- make new line (21) in s_main.lua local classACL = aclGetGroup( class.name ); local plrAccount = getPlayerAccount( client ); if ( classACL and ( not isGuestAccount( plrAccount ) ) or ( not isObjectInACLGroup( "user." .. getAccountName( plrAccount ), classACL ) ) ) then outputChatBox( "You are not member of this team/gang. Please, choose different team!", client, 200, 50, 50 ); requestMenu( client ); return; end local skin = class.skinMngr.skins[ skinIndex ]; local spawn = true; local spawned; --[[if not classGroups[ cetegoryIndex ].owner then -- if there is NO owner of the clan/gang spawn player spawn = true; else -- if there IS owner of the clan/gang then check if he's member of the clan/gang end]] if spawn then if not class.team then class.team = createTeam( class.name, class.color.red, class.color.green, class.color.blue ); end local plrTeam = getPlayerTeam( client ); if ( ( plrTeam ) and ( plrTeam ~= class.team ) and ( countPlayersInTeam( plrTeam ) == 1 ) ) then destroyElement( plrTeam ); end spawned = spawnPlayer( client, skin.spawnLoc.x, skin.spawnLoc.y, skin.spawnLoc.z, skin.spawnLoc.rot, skin.modelId, 0, 0, class.team ); end if spawned then setElementData( client, "team", class.name ) setElementData( client, "skin", skin.name ) fadeCamera( client, true ); setCameraTarget( client, client ); setTimer( setCameraTarget, 200, 1, client, client ); triggerClientEvent( client, "spawn_SpawnedSuccessfully", client ); --setPlayerMoney( client, 500 ); for _, weapon in ipairs( class.weaponMngr.weapons ) do giveWeapon( client, weapon.id, weapon.ammo, false ); end createBlipAttachedTo( client, 0, 2, class.color.red, class.color.green, class.color.blue ) else triggerClientEvent( client, "spawn_FailedToSpawn", client ); if countPlayersInTeam( class.team ) == 0 then destroyElement( class.team ); class.team = nil; end end end end ); addEvent( "spawn_receivePassword", true ); addEventHandler( "spawn_receivePassword", g_root, function( ) end ); addEventHandler( "onPlayerSpawn", g_root, function ( ) end ); addEventHandler( "onPlayerWasted", g_root, function( ) fadeCamera( source, false, 4 ); setTimer( requestMenu, 5000, 1, source ); deleteAllPlayerBlips( source ) end ); function requestMenu( player ) callClientFunc( player, "showSpawnMenu", true, true ); callClientFunc( player, "classSelected" ); end addCommandHandler( "kill", function( plr ) killPed( plr ); end ) function preloadClassesInfo( ) local groups = getElementsByType( "category" ); for _, group in ipairs( groups ) do table.insert( classGroups, Group:New( group ) ); end end addEventHandler( "onResourceStart", getResourceRootElement(), preloadClassesInfo ) function deleteAllPlayerBlips(player) local elements = getAttachedElements(player) if (elements) then for i, element in ipairs(elements) do if (getElementType(element) == "blip") then destroyElement(element) end end end print( "number of players in team: " .. tostring( countPlayersInTeam( getPlayerTeam( player ) ) ) ); end addEventHandler( "onPlayerQuit", g_root, function() deleteAllPlayerBlips(source) end ); ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ function callClientFunc( player, funcName, ... ) if #{ ... } ~= 0 then triggerClientEvent( player, "_clientCallFunction", root, funcName, ... ) else triggerClientEvent( player, "_clientCallFunction", root, funcName ) end end addEvent( "_serverCallFunction", true ) addEventHandler( "_serverCallFunction", root, function( funcName, ... ) _G[ funcName ](...) end ) Like this?
  21. Works thanks. but it spams my server if they press enter more than 5 times in less than 1 seconds its spam, it should be like 1 time every 3 seconds can you do that plz?
  22. In this one where do I put this lua? what file name?
×
×
  • Create New...