Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. IIYAMA

    Head Rotation

    I will look at it tomorrow, probably because the camera end stops at the player. It should be extended.
  2. IIYAMA

    Head Rotation

    ignore pa3ck his post, it seems he doesn't know what the source is.... Btw try this: (not tested) It will give you better information about the head rotation, the default update of the camera matrix is 4 secs. addEvent("sendRotateHead",true) addEventHandler("sendRotateHead",root, function (xr,yr,zr) if isElement(source) then -- make sure he is still in game triggerClientEvent(root,"rotateHead",source,xr,yr,zr) end end) local headUpdateFunction = function () local x,y,z,xr,yr,zr = getCameraMatrix(localPlayer) if xr and getElementHealth(localPlayer) > 0 then triggerServerEvent("sendRotateHead", localPlayer, xr,yr,zr) end end addEventHandler("onClientResourceStart",root, function () setTimer(headUpdateFunction,1000,0) end) addEvent("rotateHead", true) addEventHandler("rotateHead", root, function(xr,yr,zr) if isElement(source then -- make sure he is still in game setPedLookAt (source, xr,yr,zr, 100) end end) Updated.
  3. IIYAMA

    Head Rotation

    send this information over from server to client: https://wiki.multitheftauto.com/wiki/GetCameraMatrix float targetX, float targetY, float targetZ
  4. IIYAMA

    Head Rotation

    Well triggerClientEvent or elementdata. - TriggerClientEvent uses 3+ times more data but you can choose what player receives the data. (the closes players) - ElementData uses less data but it will send to all players directly. It depends on this: - 30+ players and for big maps (or full gta san) use triggerClientEvent. - Less players and players are all in the same part of the world, use elementdata. Use the command: /shownetstat to choose between those ways of data transfer.
  5. IIYAMA

    OOP functions

    yes, I had same result.
  6. IIYAMA

    OOP functions

    To be honest I have no idea how to connect those tables. When you send them over with triggerClientEvent, only a copie remains of the table from serverside. Also when you set the lua file as client and serverside, you also will have a copie. But I will try to find this secret. Ik weet niet hoever dit mogelijk is.
  7. IIYAMA

    OOP functions

    Meta tables, hmm I have never tried to use them because they never had any extra use for me. I always did things like this: local myTable Information = Table1[variable] or Table2[vaiable] So it is possible to set a meta table from client to serverside? Bedankt!
  8. freeroam running? Then freeroam also outputs.
  9. IIYAMA

    OOP functions

    I have heard some things about the OOP system, about that it is faster etc. But is this all ready possible and able to use? If "yes" were can I find how to use it? Because I have never seen an OOP system. Thank you
  10. 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)
  11. and what was the problem?
  12. 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,
  13. maybe you should debug it......
  14. https://wiki.multitheftauto.com/wiki/Ge ... oundingBox
  15. -- 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
  16. IIYAMA

    Help my script

    this is how you do that serverside. https://wiki.multitheftauto.com/wiki/TextCreateDisplay
  17. It will die, unless you made one of the stupid mistakes in your live.
  18. 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!
  19. 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.
  20. 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.
  21. 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.
  22. IIYAMA

    kill cam

    function( source )
  23. are you in the same team?
  24. IIYAMA

    Events

    Parachute script uses elementdata: if getElementData ( player, "parachuting") then
  25. 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......
×
×
  • Create New...