Jump to content

IIYAMA

Moderators
  • Posts

    6,063
  • Joined

  • Last visited

  • Days Won

    209

Everything posted by IIYAMA

  1. Just give up... stealing is a bad thing you know.
  2. To solve this problem you have to give the ped ammo, after it streams-in for a certain player. https://wiki.multitheftauto.com/wiki/On ... ntStreamIn
  3. @Tw1xee Why would you repeat a pixel in css in order to fill it? Isn't that just wasting GPU power on the render engine of the browser? If you had 2 pixels of differed colours, it might be handy for creating a pattern. But one pixel is just > O_o
  4. New pc's only have more cores or a little bit extra ghz. But mta only uses 1 core. So also normal pc's can do that too. I am sure your pc can run this without crashing: setTimer(function () for i=1, 100 do triggerServerEvent("serverEvent",localPlayer) end end,1000,0) addEvent("serverEvent",true) addEventHandler("serverEvent",root, function () end)
  5. Move line 3 t/m 6 out of the function storeLastPage. Because every time you trigger onClientBrowserNavigate, it will create a new function which will send you to this lastPage. There is just one thing I do not know. If the onClientBrowserNavigate is triggered, getBrowserURL will send back the new url or the old one. This is something you have to debug by yourself.
  6. Disable the right at the default user group in the acl. (which you probably didn't do) And enable it on your admin group. (which you probably did do) And this to prevent unwanted warnings.(line 5 and 6) local tcr,tcg,tcb = 255,255,255 local players = getElementsByType("player") local team = getPlayerTeam(source) if team then tcr,tcg,tcb = getTeamColor(team) end
  7. Yes, it happen when you enter to some servers are not scripted professionally, you feel with the FPS drop each time, if the FPS dropped that mean the usage of CPU used alot This has nothing to do with it. My fps will not drop when I execute a trigger event 100 times per second. Disconnecting and crashing is not the same thing. You will get disconnected when you lose connection with the server. And you will crash when your cpu can't handle it any more. And I don't crash, I only get disconnected. Which means my cpu is doing just fine. The only way you can know this, is by thinking logic or test it yourself.
  8. Oh there is. You can simply test that by using an amount of triggerServerEvent's on the rate of the "onClientRender" event. If you have a normal pc, you will get disconnected before your game starts to crash.
  9. This is circa my list of benefits between those two. triggerClientEvent Faster. (priority) Can have a sending to > target. Uses more bandwidth per player. Because of the high priority it can cause de-sync/time-outs when it is used frequently. (more than 30 per second, depending on your internet speed) setElementData Uses less bandwidth per player. (a lot less) Can be easier used between other scripts. Doesn't have a sending to > target. Uses more bandwidth depending on the player count.(total) Is slower. (priority) Remains intact after the resource stops. Legend: ► Good ► Not good ► Both
  10. When you work with offset instead of absolute positions, you won't have that problem. Also I do not know how this code should be looking. Maybe it is better to make a screenshot of it and a photoshopped version of how it should be working.
  11. IIYAMA

    RPG aiming

    Well I am not going to test it for you. I was able to do it in the past, but I can't remember which aim property's to turn on and off. Try this time to turn flag_aim_arm off. setWeaponProperty ( 32,"pro","flag_aim_arm", false ) setWeaponProperty ( 32,"std","flag_aim_arm", false ) setWeaponProperty ( 32,"poor","flag_aim_arm", false ) And if that doesn't work, try to disable/enable "flag_aim_free" etc. till you find the right combination. And make sure those are correct: setWeaponProperty ( 32,"pro","flag_move_and_aim", true ) setWeaponProperty ( 32,"std","flag_move_and_aim", true ) setWeaponProperty ( 32,"poor","flag_move_and_aim", true ) setWeaponProperty ( 32,"pro","flag_move_and_shoot", true ) setWeaponProperty ( 32,"std","flag_move_and_shoot", true ) setWeaponProperty ( 32,"poor","flag_move_and_shoot", true )
  12. IIYAMA

    RPG aiming

    This flag changes the way you aiming, which change partly how the animation must be. When those get changed, it will pick partly a default version of the animation. But this doesn't affect any specific information about this animation. I can turn a tec9 to a way of shooting with an m4(or at least the camera). But I can't edit how this animation must look like.
  13. You might not be able to sync a variable. But you can sync it through a meta table. (which I haven't used a single time in my live...) Server local sourceTable = {} local storeInSourceTable = setmetatable({}, {__newindex = function (thisTable, key, value) sourceTable[key] = value triggerClientEvent(root,"syncData",resourceRoot,key,value) end}) storeInSourceTable["myKey"] = "myData" -- debug -- outputChatBox(tostring(storeInSourceTable["myKey"])) -- nil < keep this in mind. outputChatBox(sourceTable["myKey"]) -- "myData" ----------- Client local sourceTable = {} addEvent("syncData",true) addEventHandler("syncData",resourceRoot, function (key,value) sourceTable[key] = value end)
  14. IIYAMA

    RPG aiming

    As I said before, you can't change the animation, because it is not supported. But you are not listening at all. You can only change the aim method. There is no specific stance for M4, there are multiple "flags" that you have to change in order to get that result. And most of them are unavailable.
  15. IIYAMA

    RPG aiming

    You are talking nonsense... This has nothing to do with a M4 id. setWeaponProperty ( 32,"pro","flag_aim_arm", true ) setWeaponProperty ( 32,"std","flag_aim_arm", true ) setWeaponProperty ( 32,"poor","flag_aim_arm", true )
  16. IIYAMA

    RPG aiming

    Remove everything, except line 4... No event needed, just that line.
  17. IIYAMA

    Laser

    That is not so hard, you can do that by yourself. getPlayerTeam
  18. IIYAMA

    Laser

    Try this: local imageLocation = "image.png" local imageSizeX,imageSizeY = 100,100 local extendLine = function ( x,y,z,x2,y2,z2,length ) local vx = x2 - x local vy = y2 - y local vz = z2 - z local ratio = length/(getDistanceBetweenPoints3D ( x,y,z,x2,y2,z2 )) vx = vx*ratio vy = vy*ratio vz = vz*ratio return (x + vx),(y + vy),(z + vz) end local texture = dxCreateTexture(imageLocation,"dxt5") or imageLocation -- createTexture + fallback local renderTankLine = function () local theVeh = getPedOccupiedVehicle(localPlayer) if theVeh and getElementModel(theVeh) == 432 then local x,y,z = getVehicleComponentPosition( theVeh, "misc_c","world" ) local x1,y1,z1 = getVehicleComponentPosition( theVeh, "misc_a","world" ) if x and x1 then local endX,endY,endZ = extendLine(x1,y1,z1,x,y,z,10000) local hit,endX2,endY2,endZ2,hitElement = processLineOfSight ( x,y,z,endX,endY,endZ, true, -- checkBuildings true, -- checkVehicles true, -- checkPlayers true, -- checkObjects true, -- checkDummies false, -- seeThroughStuff false, -- ignoreSomeObjectsForCamera false, -- shootThroughStuff theVeh -- ignoredElement ) local laserColor = tocolor(0,255,0,255) if hit then endX,endY,endZ = endX2,endY2,endZ2 if hitElement then local elementType = getElementType(hitElement) if elementType == "vehicle" or elementType == "ped" then laserColor = tocolor(255,0,0,255) end end end local imageCenterX,imageCenterY = getScreenFromWorldPosition (endX,endY,endZ) if imageCenterX and imageCenterY then dxDrawImage(imageCenterX-imageSizeX/2,imageCenterY-imageSizeY/2,imageSizeX,imageSizeY,texture) end dxDrawLine3D (x,y,z,endX,endY,endZ,laserColor,10) end end end addEventHandler("onClientRender",root,renderTankLine)
  19. Try it first yourself and show us what you did.
  20. IIYAMA

    Laser

    Syntax projectile createProjectile ( element creator, int weaponType [, float posX, float posY, float posZ, float force = 1.0, element target = nil, float rotX, float rotY, float rotZ, float velX, float velY, float velZ, int model ] ) projectile createProjectile ( element creator, int weaponType [, float posX, float posY, float posZ, float force = 1.0, [color=#FF0000]element target = nil[/color], float rotX, float rotY, float rotZ, float velX, float velY, float velZ, int model ] )
  21. IIYAMA

    Laser

    You can do that yourself. I am here to tell you how etc. and help you, but I am not going to change every little part. https://wiki.multitheftauto.com/wiki/CreateProjectile
  22. IIYAMA

    Laser

    Line 24: if not veh or getElementModel(veh) ~= 425 then return end
  23. IIYAMA

    RPG aiming

    That should probably be: "anim_group" https://wiki.multitheftauto.com/wiki/GetWeaponProperty But this is a get only property, MTA can't do it yet. They(MTA team) didn't give this priority, so that's unfortunately.
×
×
  • Create New...