Jump to content

IIYAMA

Moderators
  • Posts

    6,063
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. what if you load them more slowly? local objnum = #objs local amountOfLoops = math.ceil(objnum/100) local index = 1 setTimer(function () for i=1,100 do local v = objs[index] if v then -- do your thing.... --------------------- index = index+1 else break end end end,50,amountOfLoops)
  2. debuging doesn't mean you only have to watch the errors, you have to check how far the script goes and were it stops working. By using outputChatBox. I am not going to test it,
  3. maybe you should debug it......
  4. https://wiki.multitheftauto.com/wiki/Ge ... oundingBox
  5. -- root = getRootElement() -- don't redefine something that is already defined. local SwitchEngine SwitchEngine = function ( source ) local theVehicle = getPedOccupiedVehicle ( source ) if theVehicle and getVehicleController ( theVehicle ) == source then local state = getVehicleEngineState ( theVehicle ) setVehicleEngineState ( theVehicle, not state ) else unbindKey ( source,"x","down",SwitchEngine ) end end local BindKeyEnter = function (vehicle) bindKey ( source,"x","down",SwitchEngine ) end local BindKeyExit = function (vehicle) unbindKey ( source,"x","down",SwitchEngine ) end addEventHandler ( "onVehicleEnter", root, BindKeyEnter ) -- not onVehicleStartEnter addEventHandler ( "onVehicleExit", root, BindKeyExit ) -- not onVehicleStartExit
  6. IIYAMA

    Help my script

    this is how you do that serverside. https://wiki.multitheftauto.com/wiki/TextCreateDisplay
  7. It will die, unless you made one of the stupid mistakes in your live.
  8. No the problem starts here, starts at you. A player can't kill a bot from the same team. Try this: local Exercito = getTeamFromName ( "Exercito" ) if not Exercito then Exercito = createTeam ( "Exercito",0, 255, 0) for i=1,5 do outputChatBox("failure to get Exercito team, so recreate the team.") end end -- put the variables in to locals -- local nemesi,BlipExercito ------------------------------------ function Exercitosobymanawydan ( thePlayer) local AclNome = getAccountName ( getPlayerAccount ( thePlayer ) ) if AclNome and isObjectInACLGroup ("user."..AclNome, aclGetGroup ( "Admin" ) ) then if nemesi and isElement(nemesi) then destroyElement(nemesi) end if BlipExercito and isElement(BlipExercito) then destroyElement(BlipExercito) end nemesi = exports [ "slothBot" ]:spawnBot ( 103.65139007568,1902.8734130859,33.8984375, 90, 287, 0, 0, Exercito, 34, "guarding", true ) --setElementModel ( nemesi, 287 ) --math.random ( 300, 303 ) BlipExercito = createBlipAttachedTo ( nemesi, 0, 2, 11, 86, 16, 255, 1) triggerClientEvent ( "nsound", root ) setElementData(nemesi, "exercito",true) if nemesi then exports.extra_health:setElementExtraHealth ( nemesi, 100 ) end end end addCommandHandler("exercito", Exercitosobymanawydan) setTimer ( destroyElement, 3600000, 0, slothbot) -- wtf? addEvent("onBotWasted",true) addEventHandler("onBotWasted",getRootElement(), function (killer) if (source == nemesi) and killer and getElementType(killer) == "player" then givePlayerMoney(killer,math.random(4000,6000)) outputChatBox ( getPlayerName ( killer ) .. " #081DBFmatou um soldado",getRootElement(), 255, 255, 255, true ) exports.exp_system:addPlayerEXP ( killer, 600 ) if BlipExercito and isElement(BlipExercito) then destroyElement(BlipExercito) end end end) function SetAdmExercitoTeam(thePlayer) local AclNome = getAccountName ( getPlayerAccount ( thePlayer ) ) if AclNome and isObjectInACLGroup ("user."..AclNome, aclGetGroup ( "Admin" ) ) then setPlayerTeam ( thePlayer, Exercito ) end end addCommandHandler("nemesiTeam",SetAdmExercitoTeam) local testTeam = createTeam ( "testTeam",255, 0, 0) local function SetAdmTestTeam(thePlayer) local AclNome = getAccountName ( getPlayerAccount ( thePlayer ) ) if AclNome and isObjectInACLGroup ("user."..AclNome, aclGetGroup ( "Admin" ) ) then setPlayerTeam ( thePlayer,testTeam) end end addCommandHandler("testteam",SetAdmTestTeam) Write down /testteam before you start shooting at the ped. Not tested!
  9. Recording client side, yes but that would mean constant rendering player locations and save them of the last 10 second. Sample: 60 alive players. Max 60 frames per sec. 600 = 60 x 10 sec Data: 600 x positions, 600 x rotations, 600 x aim positions. This data x 60. I would say wastage of the performance, but yes it is possible.
  10. you also can do just 1 frame, recording will request a lot of power from the server. Just 1 frame, Rotation, position and the aim direction to the target.
  11. wtf! O_o A function is a value that needs to be stored at some place. He already put it inside his event handler. A both all, that wasn't his problem at the first place. His problem is this: (in slot bot) addEventHandler("onClientPedDamage",root, -- check if same team, then cancel....... cancelEvent() end) But it seems slot bot doesn't get the right information, to do it's job.
  12. IIYAMA

    kill cam

    function( source )
  13. are you in the same team?
  14. IIYAMA

    Events

    Parachute script uses elementdata: if getElementData ( player, "parachuting") then
  15. I could use the same script on most other weapons and have success. setWeaponProperty (29, "pro", "accuracy", 2) That would work fine on a MP5, but if I try to use it on a minigun, nope. I am very new to Lua and spread is something I'm unfamiliar with. I don't see how a get only [whatever word goes here] would work on a set function or whatever it's called. I didn't show you the solution now, but I hope it will be the solution in the future. Now it is "get only", but in the future it may will be both. I also want it to be enabled, but most of the development guys aren't really specialising in building functions for deathmatch gamemodes......
  16. cause accuracy needs the property: "spread" also. But: "spread" = Get only ......................................................... and fire rate is "get only" also.
  17. Correct some kind of flying bug cause of this function: setElementCollisionsEnabled Remove the collision of the attached elements instead of the vehicle. Or use this function instead at clientside: setElementCollidableWith
  18. The reason for that is that you can't hit arms with a vehicle. Arms don't have collisions for vehicles or objects. Just like many other bodyparts. Maybe you noticed this: When you go sprint against a wall, 40% of your head is in the wall. Well here is one with a car ^^ http://img708.imageshack.us/img708/8164/4w9i.png ------------------------------------------------------------------------------------------- On the other hand everything can be calculated..... getPedBonePosition getDistanceBetweenPoints3D -- or processLineOfSight
  19. Then you got a really slow pc O_o or you have put the code serverside...
  20. and what should it have done and didn't do?
  21. Try this: (added some delay for test) addEventHandler("onClientResourceStart",resourceRoot, function() setTimer(function () if isTransferBoxActive() then fadeCamera(false) else fadeCamera(true) end end,300,1) end) -- You don't need this line, resourceRoot is predefined in mta-- -- resourceRoot = getResourceRootElement(getThisResource()) --------------------------------------------------------------------------------
  22. IIYAMA

    Help my script

    modification: You don't have to redefine the vehicle when the timer and the function are in the same block. But it is always handy to prevent errors by checking if elements still does exist. disco.timer[source] = setTimer( function() -- veh if isElement(vehicle) then setVehicleOverrideLights(vehicle, 2) setVehicleHeadLightColor(vehicle, math.random(0,255), math.random(0,255), math.random(0,255) ) end end, 150, 0)--vehicle
  23. Serverside is for everybody visible, client only for the pc that executed it. - For client, BieHDC sample. <<< - For server if isElement(source) then --[[ or when you are to foolish to send a vehicle/object/ped instead of player then:]] if isElement(source) and getElementType(source) == "player" then Also: if ( getDistanceBetweenPoints3D(x, y, z, -23, 1423, -23) <= "20" ) then if ( getDistanceBetweenPoints3D(x, y, z, -23, 1423, -23) <= 20 ) then Also addCommandHandler doesn't give a player as source, if you did that!
  24. Why not setElementPosition? Also: https://wiki.multitheftauto.com/wiki/IsPedInVehicle
×
×
  • Create New...