Jump to content

isa_Khamdan

Members
  • Posts

    484
  • Joined

  • Last visited

Everything posted by isa_Khamdan

  1. hmm I know how to do it but how can I make it exists on the whole resource not in the function only if I put local it will only exists on that function :
  2. It doesn't respawn the vehicle if it get destroyed from admin panel local Car = createVehicle ( 547, 3108, -3178, 0 ) function Check() if not (isElement(Car)) then respawnVehicle ( Car ) end end setTimer ( Check, 1000, 0)
  3. isa_Khamdan

    Question

    Hello , I have created a vehicle on my code outside function and i added local so it will only exists on this resource and my question is how can i re-create the vehicle after it get destroyed? Else i want it to replace the old variable but it will have the same name. local Car = createVehicle(model ,x,y,z) function() ..... end
  4. So I just need to move the first part down and the second part should be on the bottom?
  5. Hello , I am getting this error in line 23 so how can I fix it? I want to cancle all outputchatmessage for people in this acl group or if they used bad words from table. it's working but it show this error "attempt to index global "v" (a nill value)" chatTime = {} lastChatMessage = {} addEventHandler("onPlayerChat", getRootElement(), function(text, msgtype) local result = SQLS3D.qury("SELECT * FROM Tags_System") if ( type ( result ) == "table" and #result == 0 or not result ) then return end local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) local new = "" local iter = 0 msg = string.gsub(text,"ـ","") for word in msg:gmatch("%S+") do iter = iter + 1 for i,swr in ipairs(words) do local src = word:lower():gsub("%s","") local src = src:gsub("#%x%x%x%x%x%x","") local src = src:gsub("%c","") local src = src:gsub("%p","") local pat = swr:lower():gsub("%s","") if src:find(pat) or isObjectInACLGroup ("user."..account, aclGetGroup ( "Nick" ) ) then cancelEvent() outputChatBox('#'..v["color1"]..' ' ..v["name"]..' '.. getPlayerName ( source ) .. ' : #'..v["color2"]..''..text..'', getRootElement(), r, g, b, true ) break end end if iter == 1 and word:len() > 2 then word = word:gsub("%a",string.upper,1) end new = new..word.." " end if new ~= "" then msg = new end text = msg if chatTime[source] and chatTime[source] + tonumber(1000) > getTickCount() then cancelEvent() outputChatBox("Stop spamming main chat!", source, 255, 0, 0) return else chatTime[source] = getTickCount() end if lastChatMessage[source] and lastChatMessage[source] == text then cancelEvent() return outputChatBox("Stop repeating yourself!", source, 255, 0, 0) end lastChatMessage[source] = text local r, g, b = getPlayerNametagColor(source) cancelEvent() for k, v in ipairs(Tag) do if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup(v["tag"])) then cancelEvent() outputChatBox('#'..v["color1"]..' ' ..v["name"]..' '.. getPlayerName ( source ) .. ' : #'..v["color2"]..''..text..'', getRootElement(), r, g, b, true ) break end end end )
  6. you didn't add the event in your code.
  7. Hello , This is Jail System made by Al3grb but it have some problems need to be fixed so the first problem was the timer get stuck when you jail more than one player ( this problem has been fixed by Castillo ) and the second problem is that the text still get stuck on the screen when the timer finish so can anyone tell me how to fix this problem? Server side --***********************************-- --***********************************-- -- 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 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(theTimers [ plr ]) then killTimer(theTimers [ plr ]) end theTimers [ plr ] = 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
  8. You can create a bot using a script that can be found on the community then you replace the model of the skin used for the bot with a dog , cat skin or anything you want.
  9. Then maybe you triggered the event for all clients , you should trigger it for the player who locked/unlocked his vehicle only ( source ).
  10. that's because you used play sound on server side.
  11. Ask Solidsnake14 ( Castillo ) I think he do such scripts like this for fair price. Else xXMADEXx may do it too.
  12. thePlayer is not defined anywhere in your code. Try this function spawn(thePlayer) if not isElement(thePlayer) then return end local x, y, z = getElementPosition(thePlayer) until spawnPlayer(thePlayer, x, y, z) fadeCamera(thePlayer, true) setCameraTarget(thePlayer, thePlayer) end addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 1000, 1, source) end )
  13. The problem only happen if I use luac.multitheftauto.com to compile the script.
  14. Nvm , The problem caused by the encryption
  15. إذا الصوره شغاله في السيرفر ويطلع عندك هالكلام , افتحها ببرنامج الفوتشوب او اي برنامج ثاني ورد احفظها بمثل الإسم والصيغه وارفعها وبتنحل المشكله بإذن الله والسبب هو الضغط المتكرر للملف يعني مثلاً اذا عندك مود كل مره تضغطه وتفكه وترفعه مع الوقت الصوره الموجوده بالملف تتأثر وتطلع هالمشكله.
  16. Hello , I have problem with warppedintovehicle , The problem is that the ped never get warped to the vehicle I tried to fix it with timers and stuffs ( e.g. creating vehicle and ped then using warp after 5 seconds to warp the ped into vehicle ) It works 100% on my offline server but when I upload it to my online server it doesn't work I just see the ped standing next to the vehicle. So can anyone tell me how to fix it? function hideL() vehicle = createVehicle ( 529, -2069.2124023438, 1844.8651123047, 17.2 , 0 , 0 , 0 ) setVehicleColor ( vehicle, 0, 0, 0 ) addVehicleUpgrade ( vehicle , 1010 ) ped = createPed ( 46, -2069.2124023438 + 1, 1844.8651123047 + 1 , 17.2 ) warpPedIntoVehicle ( ped , vehicle ) end addEvent("hideL", true) addEventHandler("hideL", getRootElement(), hideL) Edit: This script is client sided.
  17. I removed local and it's working now
  18. Then how I am getting this error?
  19. Yes it's in the same script. Else I am getting problem with the source code ( after the timer finish it keep showing warnings and errors cuz the objects have been destroyed but it keep checking for their position and that's mean that the RemoveCamRender have problem)
×
×
  • Create New...