Jump to content

codeluaeveryday

Members
  • Posts

    575
  • Joined

Everything posted by codeluaeveryday

  1. You have two options, find where sX and sY variables are created and simply subtract the some random numbers off sY. Alternatively just redefine them: sY = sY - 100 -- Replace this number to suit your position img = { url = {"data/img/map.png","data/img/tune.png","data/img/music.png","data/img/stats.png","data/img/plus.png","data/img/options.png"}, pos = {{sX/2-(((sY/10)+(sY/40))*3),sY},{sX/2-(((sY/10)+(sY/40))*2),sY},{sX/2-((sY/10)+(sY/40)),sY},{sX/2+(sY/40),sY},{sX/2+(((sY/10)+((sY/40)*2))),sY},{sX/2+(((sY/10))*2+(sY/40)*3),sY}}, size = {sY/10,sY/10}, alpha = {150,255,255,255,255,255,255} }
  2. Can you add piglatin? I am fluent in it lol, most people don't know the rules of it. I'll translate just bout all of it.
  3. Woops posted wrong link, I just remembered the one on our server is private. Use this for a crosshair, easily modifiable: https://community.multitheftauto.com/index.php?p= ... ls&id=6758
  4. CrystalMV, read what he wants again, you are far off topic.
  5. 1: https://community.multitheftauto.com/index.php?p= ... ls&id=3715 2: They most likely made their own, I made my one for K@N zombies.
  6. Ok all good, I also made an edit for a more viable solution.
  7. Man I thought you were a web developer. Php code (basic): <?php echo $_SERVER['REMOTE_ADDR']; ?> It is more effective to use this, as some servers might be configured retard-idly: <?php $ipaddress = ''; if ($_SERVER['HTTP_CLIENT_IP']) $ipaddress = $_SERVER['HTTP_CLIENT_IP']; else if($_SERVER['HTTP_X_FORWARDED_FOR']) $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; else if($_SERVER['HTTP_X_FORWARDED']) $ipaddress = $_SERVER['HTTP_X_FORWARDED']; else if($_SERVER['HTTP_FORWARDED_FOR']) $ipaddress = $_SERVER['HTTP_FORWARDED_FOR']; else if($_SERVER['HTTP_FORWARDED']) $ipaddress = $_SERVER['HTTP_FORWARDED']; else if($_SERVER['REMOTE_ADDR']) $ipaddress = $_SERVER['REMOTE_ADDR']; else $ipaddress = 'UNKNOWN'; echo $ipaddress; ?> Lua code: fetchRemote("example.com/path/to/php/file", doStuff) function doStuff(responseData, errno) -- put shit here, responseData is the ip end
  8. IFahad's code won't work again, you need to addEvent before registering the event. Otherwise lua doesn't recognize it (I think) Server: function ZombieKill ( killer, weapon, bodypart) if (killer and killer ~= source) then if bodypart == 9 then setPedStat(killer, 69, getPedStat(killer, 69) + 5) end end end addEvent("onZombieWasted", true) addEventHandler("onZombieWasted",getRootElement(),ZombieKill) Client: --[[------------------------------------------------- Notes: > This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running. To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there. --]]------------------------------------------------- GUIEditor = { window = {}, staticimage = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(295, 115, 457, 548, "Weapon Skills Panel", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.staticimage[1] = guiCreateStaticImage(25, 46, 63, 58, ":shop1/images/22.png", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(90, 84, 22, 15, "0%", false, GUIEditor.window[1]) end ) function Nothing() guiSetText(GUIEditor.label[1], getPedStat(localPlayer, 69)) end addEventHandler("onClientRender", getRootElement(), Nothing) bindKey("F7","Down",function() guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) showCursor(guiGetVisible(GUIEditor.window[1])) end)
  9. Thank you all so much for your feedback! If you find any bug with the codes provided please let me know.
  10. Hey guys, thought I'd share this with the loving community of MTA. I know the current admin panel lacks some flags, so I spoke to a friend about it, I had the idea of finding the flags and adding them manually, then I thought it would takes ages, then he made a basic Lua code to process all the files and sort them. This will basically allow you to be able to have more flags on your server, if you use this on top of the 'TUT] Updating Admin Countries' everyone will have a flag. Steps Download these flags Extract all the images into the ':admin/client/images/flags' folder. Open up the meta.xml and remove the old tags for the flags only. Add these to the meta.xml: "client/images/flags/ad.png" /> "client/images/flags/ae.png" /> "client/images/flags/af.png" /> "client/images/flags/ag.png" /> "client/images/flags/ai.png" /> "client/images/flags/al.png" /> "client/images/flags/am.png" /> "client/images/flags/an.png" /> "client/images/flags/ao.png" /> "client/images/flags/ar.png" /> "client/images/flags/as.png" /> "client/images/flags/at.png" /> "client/images/flags/au.png" /> "client/images/flags/aw.png" /> "client/images/flags/ax.png" /> "client/images/flags/az.png" /> "client/images/flags/ba.png" /> "client/images/flags/bb.png" /> "client/images/flags/bd.png" /> "client/images/flags/be.png" /> "client/images/flags/bf.png" /> "client/images/flags/bg.png" /> "client/images/flags/bh.png" /> "client/images/flags/bi.png" /> "client/images/flags/bj.png" /> "client/images/flags/bm.png" /> "client/images/flags/bn.png" /> "client/images/flags/bo.png" /> "client/images/flags/br.png" /> "client/images/flags/bs.png" /> "client/images/flags/bt.png" /> "client/images/flags/bv.png" /> "client/images/flags/bw.png" /> "client/images/flags/by.png" /> "client/images/flags/bz.png" /> "client/images/flags/ca.png" /> "client/images/flags/cc.png" /> "client/images/flags/cd.png" /> "client/images/flags/cf.png" /> "client/images/flags/cg.png" /> "client/images/flags/ch.png" /> "client/images/flags/ci.png" /> "client/images/flags/ck.png" /> "client/images/flags/cl.png" /> "client/images/flags/cm.png" /> "client/images/flags/cn.png" /> "client/images/flags/co.png" /> "client/images/flags/cr.png" /> "client/images/flags/cs.png" /> "client/images/flags/cu.png" /> "client/images/flags/cv.png" /> "client/images/flags/cx.png" /> "client/images/flags/cy.png" /> "client/images/flags/cz.png" /> "client/images/flags/de.png" /> "client/images/flags/dj.png" /> "client/images/flags/dk.png" /> "client/images/flags/dm.png" /> "client/images/flags/do.png" /> "client/images/flags/dz.png" /> "client/images/flags/ec.png" /> "client/images/flags/ee.png" /> "client/images/flags/eg.png" /> "client/images/flags/eh.png" /> "client/images/flags/er.png" /> "client/images/flags/es.png" /> "client/images/flags/et.png" /> "client/images/flags/fi.png" /> "client/images/flags/fj.png" /> "client/images/flags/fk.png" /> "client/images/flags/fm.png" /> "client/images/flags/fo.png" /> "client/images/flags/fr.png" /> "client/images/flags/ga.png" /> "client/images/flags/gb.png" /> "client/images/flags/gd.png" /> "client/images/flags/ge.png" /> "client/images/flags/gf.png" /> "client/images/flags/gh.png" /> "client/images/flags/gi.png" /> "client/images/flags/gl.png" /> "client/images/flags/gm.png" /> "client/images/flags/gn.png" /> "client/images/flags/gp.png" /> "client/images/flags/gq.png" /> "client/images/flags/gr.png" /> "client/images/flags/gs.png" /> "client/images/flags/gt.png" /> "client/images/flags/gu.png" /> "client/images/flags/gw.png" /> "client/images/flags/gy.png" /> "client/images/flags/hk.png" /> "client/images/flags/hm.png" /> "client/images/flags/hn.png" /> "client/images/flags/hr.png" /> "client/images/flags/ht.png" /> "client/images/flags/hu.png" /> "client/images/flags/id.png" /> "client/images/flags/ie.png" /> "client/images/flags/il.png" /> "client/images/flags/in.png" /> "client/images/flags/io.png" /> "client/images/flags/iq.png" /> "client/images/flags/ir.png" /> "client/images/flags/is.png" /> "client/images/flags/it.png" /> "client/images/flags/jm.png" /> "client/images/flags/jo.png" /> "client/images/flags/jp.png" /> "client/images/flags/ke.png" /> "client/images/flags/kg.png" /> "client/images/flags/kh.png" /> "client/images/flags/ki.png" /> "client/images/flags/km.png" /> "client/images/flags/kn.png" /> "client/images/flags/kp.png" /> "client/images/flags/kr.png" /> "client/images/flags/kw.png" /> "client/images/flags/ky.png" /> "client/images/flags/kz.png" /> "client/images/flags/la.png" /> "client/images/flags/lb.png" /> "client/images/flags/lc.png" /> "client/images/flags/li.png" /> "client/images/flags/lk.png" />
  11. addEventHandler('onPlayerConnect', getRootElement(), function() local country = exports.admin:getPlayerCountry(source) if (country == 'SA') then cancelEvent( true, "Your not allowed to enter this server from Saudi Arabia" ) end end )
  12. Yeah it fucked up my server too, fixing it. ATTENTION: STEPS TO FIX: 1) Make sure admin is stopped 2) Open the admin meta.xml and set: "*useip2c" value="true" friendlyname="useip2c" group="_Advanced" accept="true,false" desc="Displays country flags next to players, set to false to save about 3MB of server RAM." /> to false: "*useip2c" value="false" friendlyname="useip2c" group="_Advanced" accept="true,false" desc="Displays country flags next to players, set to false to save about 3MB of server RAM." /> 2) Replace the 'server/admin_ip2c.lua' file to: http://pastebin.com/BbvtMvgV 3) Now go to conf folder and delete IpToCountryCompact.csv. 4) Start admin and use the /updateadmin command. I am currently working on a stronger and more efficient version. ALL USERS WHICH GOT BUGGED NEED TO DO THE MANUAL UPDATE THEIR 'server/admin_ip2c.lua' file to this: The host i use actually fucked up, so I'm going to be making a legitimate mirror system while you guys use this, that way we will never have a problem like this again.
  13. Your joking right? You have no idea what ixjf has made do you?
  14. xXMADEXx: It's not LUA, it's Lua... TheVenom, You can also learn from lua.org, the official links are found in the forum post which xXMADEXx said.
  15. My one already does this: https://community.multitheftauto.com/index.php?p= ... ls&id=5837
  16. Hermes obviously stole it, also his English is really hard to read.
  17. Your missing the server sided code. We can't help you without the other part.
  18. Thank you to all the positive comments, I am going to release the php file required for this update. This is so you can create your own mirror. Currently it is downloading from a web server of mine. Download link: http://www.mediafire.com/download/78xhr ... update.php Just change line 19 of the lua code to your php file.
  19. No problem, I was bored so I wanted to make it easier for myself to update it, so I decided I should share it with others.
  20. MD5 is not a good idea for your needs, you should use the Sha256, that's as secure as they get. I hope MTA updates to sha256/
  21. Hey man, not sure if this will work, I wrote this while at my dads work. All you have to do is use the setDrugEffectsEnabled(true) command to enable wonky running and driving, and use setDrugEffectsEnabled(false) to disable this effect. function setDrugEffectsEnabled(enabled) if enabled == true then originalVehLeft = getBoundKeys('vehicle_left')[1] originalVehRight = getBoundKeys('vehicle_right')[1] originalLeft = getBoundKeys('left')[1] originalRight = getBoundKeys('right')[1] toggleControl('vehicle_left', false) toggleControl('vehicle_right', false) toggleControl('left', false) toggleControl('right', false) bindKey(originalVehLeft, 'both', drugEffects, 'vehRight') bindKey(originalVehRight, 'both', drugEffects, 'vehLeft') bindKey(originalLeft, 'both', drugEffects, 'right') bindKey(originalRight, 'both', drugEffects, 'left') else unbindKey(originalVehLeft, 'both', drugEffects) unbindKey(originalVehRight, 'both', drugEffects) unbindKey(originalLeft, 'both', drugEffects) unbindKey(originalRight, 'both', drugEffects) end end function drugEffects(key, keyState, direction) if keyState == 'up' then keyState = true else keyState = false end if direction == 'vehLeft' then setControlState('vehicle_right', keyState) elseif direction == 'vehRight' then setControlState('vehicle_left', keyState) elseif direction == 'left' then setControlState('right', keyState) elseif direction == 'right' then setControlState('left', keyState) end end
  22. This will bug if you play a map such as Vortex V7 which stacks hunters, they will get multiple hunters, use tables to check.
  23. Oh shit, I believe your right... The problem is I am actually following a vehicle, I am unsure what it will look like, but yeah Ill try onClientPreRender. but setPedControlState nevers works either.
×
×
  • Create New...