Jump to content

Bean666

Members
  • Posts

    732
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Bean666

  1. already did that before i keep getting an error bad usage. timer interval is below 50
  2. can't there be a time table math.random is not so accurate on what i'm doing ,is it the only way? like ex: local time = { 1000, 3000 } or whatever.
  3. do the simple easy stuffs. function headShot(attacker, weapon, bodypart, loss) if (bodypart == 9) then setPedAnimation(source, "Category", "anim") -- more stuff here -- end end addEventHandler("onPlayerDamage", getRootElement(), headShot)
  4. hello is it possible to add math.random for timers like these? i tested this one but it seems not to work: any tips? timer = setTimer(function() --stuff here-- end end, math.random(1000,5000), 0)
  5. Bean666

    Help

    are the client and server defined in meta.xml ? i don't see anything wrong.
  6. aye aye thanks. what does the Teamsb = {} do?
  7. actually what i want is not like this what i wanted is all the stuff on the table not 1 2 3 stuff or maybe i just missed something , but yeah ill try something / learn on my own
  8. how do i use getTeamFromName using tables thanks in advance local teams = { "Military", "FIB", "SWAT" } local theTeam = getTeamFromName("??")
  9. non would believe such a thing. you have exports of CIT scripts and same idea as CIT. you made a huge code and exports that you can't even solve small things? lol.
  10. it's funny how these guys have / copy CIT scripts lol.
  11. hmm, maybe make a big button that has the same size with the image. and set the alpha of the button to 0.
  12. i think getElementZoneName works better than getZoneName i tried it before, and getElementZoneName works better for some reason. lol
  13. that's a great example, and btw he wants the command disabled in Dimension 366 so..: local carsBeingFixed = {} function fixVeh(thePlayer) if isObjectInACLGroup("user.".. getAccountName(getPlayerAccount(thePlayer)),aclGetGroup("DL3")) then if getElementDimension(thePlayer) ~= 366 then local vehicle = getPedOccupiedVehicle(thePlayer) if vehicle then if carsBeingFixed[vehicle] then outputChatBox("Your car is already being fixed.",thePlayer) return end outputChatBox("Your car is being fixed. Please wait a few moments.",thePlayer) carsBeingFixed[vehicle] = setTimer(function() fixVehicle(vehicle) carsBeingFixed[vehicle] = nil outputChatBox("Your car has been fixed.",thePlayer) end,15000,1) end else outputChatBox("This command(fixv) is disabled in the dimension 366",thePlayer) end end end addCommandHandler("fixv",fixVeh)
  14. not tested but try function kill (killer, weapon, bodypart, loss) if (killer) then setElementHealth(killer, getElementHealth(killer) + 10) end end addEventHandler ( "onPlayerWasted", getRootElement(), kill)
  15. anyways here( it only allows you to use explosives in las venturas): local bannedIds = { [16] = true, [17] = true, [18] = true, [39] = true, [40] = true, } local colshape = createColRectangle ( 861.20703125, 600, 2100, 2400 ) redzonemaparea = createRadarArea (861.20703125, 600, 2100, 2400, 255, 0, 0, 120) function colshapehit(player) if (getElementType(player) == "player" ) then outputChatBox("You've Entered/Left Las Venturas!", player, 255, 0, 0) end end addEventHandler("onColShapeHit", colshape, colshapehit) addEventHandler("onColShapeLeave", colshape, colshapehit) function forcePlayerWeapon(prevId, curId) if not isElementWithinColShape(source, colshape) then if bannedIds[curId] then outputChatBox("You can only use explosives in Las venturas!") setPedWeaponSlot(source, 0) end end end addEventHandler("onPlayerWeaponSwitch", root, forcePlayerWeapon)
  16. if you want only you can only use in LV then use: if not isElementWithinColShape(source, LVColShape) then
  17. here is an ex made by tails: local bannedIds = { --- weapon IDs [16] = true, [17] = true, [18] = true, [39] = true, [40] = true, } local hillAreaLS = createColRectangle ( -905.5929, -2933.0986, 4000, 3500 ) function forcePlayerWeapon(prevId, curId) if isElementWithinColShape(source, hillAreaLS) then if bannedIds[curId] then outputChatBox("blocked explosives") setPedWeaponSlot(source, 0) end end end addEventHandler("onPlayerWeaponSwitch", root, forcePlayerWeapon)
  18. Here is an example made by Tails: local bannedIds = { [16] = true, [17] = true, [18] = true, [39] = true, [40] = true, } local hillAreaLS = createColRectangle ( -905.5929, -2933.0986, 4000, 3500 ) local hillAreaSF = createColRectangle( -2994.09448,-1378.01746,2000,4900) local hillAreaLV = createColRectangle (-905.5929,602.33,4000,2500) function forcePlayerWeapon(prevId, curId) if isElementWithinColShape(source, hillAreaLS) then if bannedIds[curId] then outputChatBox("blocked explosives") setPedWeaponSlot(source, 0) end end end addEventHandler("onPlayerWeaponSwitch", root, forcePlayerWeapon)
  19. @Walid, oh yeah sorry bout that This could be useful:, it prevents people from spamming the command(which is he can bind it and repair his car all over again.): function fixVeh (thePlayer,cmd) if thePlayer and isElement(thePlayer) then local account = getPlayerAccount(thePlayer) if account and not isGuestAccount(account) then local accountName = getAccountName (account) if isObjectInACLGroup ( "user."..accountName , aclGetGroup ( "DL3" ) ) then local dimension = getElementDimension(thePlayer) local data = getElementData(thePlayer, "cooldown") if dimension ~= 366 then if isPedInVehicle(thePlayer) then local vehicle = getPedOccupiedVehicle (thePlayer) if data == false then setElementData(thePlayer, "cooldown", true) setTimer(function (veh) fixVehicle(veh) outputChatBox("Fixed", thePlayer, 255, 0,0) setElementData(thePlayer, "cooldown", false) end, 15000, 1, vehicle) outputChatBox("Fixing in 15 seconds", thePlayer) elseif data == true then outputChatBox("Please wait 15 seconds to use this command(fixv) again!", thePlayer, 255,0,0) end else outputChatBox("You can't use this ("..cmd..") when you're not inside a vehicle!",thePlayer,255,0,0) end else outputChatBox("You can't use this command when you are inside 366 dimension",thePlayer,255,0,0) end end end end end addCommandHandler( "fixv", fixVeh )
  20. if you want the car to repair in 15 seconds and if you also want the player won't be able to spam it then use this( i edited the fixVehicle and outputChatBox on Walids code): function fixVeh (thePlayer,cmd) if thePlayer and isElement(thePlayer) then local account = getPlayerAccount(thePlayer) if account and not isGuestAccount(account) then local accountName = getAccountName (account) if isObjectInACLGroup ( "user."..accountName , aclGetGroup ( "DL3" ) ) then local dimension = getElementDimension(thePlayer) local data = getElementData(thePlayer, "cooldown") if dimension ~= 366 then if isPedInVehicle(thePlayer) then local vehicle = getPedOccupiedVehicle (thePlayer) if data == false then setElementData(thePlayer, "cooldown", true) setTimer(setElementData, 15000, 1, thePlayer, "cooldown", false) setTimer(function () fixVehicle(vehicle) end, 15000, 1, true) setTimer(outputChatBox, 15000, 1, "Fixed", thePlayer, 255, 0, 0) outputChatBox("Fixing in 15 seconds", thePlayer) end if data == true then outputChatBox("PLEASE WAIT 15 SECONDS TO REPAIR AGAIN", thePlayer, 255,0,0) end else outputChatBox("You can't use this ("..cmd..") when your not inside a vehicle!",thePlayer,255,0,0) end else outputChatBox("You can't use this command when you are inside 366 dimension",thePlayer,255,0,0) end end end end end addCommandHandler( "fixv", fixVeh )
  21. here is an example, but you realize you are making a loop through all vehicles right...? so basically it will repair all vehicles with players in it. function fixVeh ( thePlayer ) setTimer (function () if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "DL3" ) ) then local dimension = getElementDimension(thePlayer) for i, vehicle in ipairs(getElementsByType("vehicle")) do if (dimension == 366) then return end fixVehicle ( vehicle ) end end end,15000, 1) end addCommandHandler( "fixv", fixVeh )
  22. might help: https://forum.multitheftauto.com/viewtopic.php?f=91&t=55688
  23. Bean666

    Question

    Alright thanks for the help , i get it now!
×
×
  • Create New...