Jump to content

Buffalo

Members
  • Posts

    283
  • Joined

  • Last visited

Everything posted by Buffalo

  1. you can trigger server event onClientResourceStart e.g. server: playersReady = {} addEvent('onPlayerFinishedDownloading',true) addEventHandler('onPlayerFinishedDownloading',getRootElement(),function() playersReady[source] = true end) addEventHandler('onPlayerQuit',getRootElement(),function() playersReady[source] = nil end) client: addEventHandler('onClientResourceStart',getResourceRootElement(getThisResource()),function() triggerServerEvent('onPlayerFinishedDownloading',getLocalPlayer()) end) and check if playersReady[player] returns true, if it does then hes not downloading
  2. Thanks, updated: http://www.mediafire.com/file/k78f5xsa4khqzz9/lua.xml
  3. Updated API with new 1.1 functions for those notepad++ users out there. Put it to a good use. http://www.mediafire.com/file/adbdl9g09lw7khy/lua.xml http://www.mediafire.com/file/k78f5xsa4khqzz9/lua.xml
  4. Yes new version has bugs, crashes, glitches and is incompatible with some systems. But all in all it's so fun, stunning and gorgeous ! It's really completely new gaming experience for GTA mp. Customize every and everything around, make gameplay smoother and forget what was miserable in 1.0. I'm enjoying creating servers in my freetime. Atm i have not so little gamemodes in the progress: Freeroam, Zombie, Trucking, Race and Roleplay from which only 3 are hosted. And im planning to continue work with LUA as long as something inside it shout like: Cmon! Just grab me and script some new stuff with new possibilities! And it really shouts it now. All those years waiting for 1.1 made worth it. Thanks MTA team !
  5. Oh temporary fix to the issue: Start Map Editor and place 1 object. Now try to enter any server that crashed before.
  6. Oh just you stop with those attachments, will ye? there is great way to do it, work-around like always: Always give player 1 bullet more than it is needed. Also note that you have to make custom hud, or at least custom ammo showing with DX draw or GUI functions. And make it show one bullet less than it really has. gMe = getLocalPlayer() addEventHandler('onClientPlayerWeaponFire',gMe,function(weapon,ammo,inClip,hitX, hitY, hitZ, hitElement) if(weapon > 15 and weapon < 19) or weapon == 39 then return if(ammo == 1) then toggleControl('fire',false) --bindKey('fire','down',playTickSound) --also make a function to play empty clip sound for better playback end end) addEventHandler('onClientPlayerWeaponSwitch',gMe,function(prevSlot,currSlot) if(getPedTotalAmmo(prevSlot) == 1) then toggleControl('fire',true) end if(getPedTotalAmmo(currSlot) == 1) then toggleControl('fire',false) end end) Of course no guarantee if it will work perfectly, as i've edited a big piece of code. And make alternative ammo showing (at least) yourself. Disable old one using showPlayerHudComponent('ammo',false)
  7. You have to destroy it and create it again.
  8. for i=1,10 do if i == 5 then break end end
  9. try follwoing: for i,v in pairs(getElementsByType('vehicle'))do toggleVehicleRespawn(v,false) end
  10. Buffalo

    peds for mta

    Actually it is hardly possible. Vehicle sync when ped is inside and driving it is horrible atm.
  11. Try to remove team color code and test without it.
  12. Can't help more than Solidsnake did. This should work and if it doesn't then something is wrong elsewhere in your script.
  13. Just use it that way: local blockRadioEvent addEventHandler('onClientPlayerRadioSwitch',root,function() if blockRadioEvent then blockRadioEvent = nil return end if conditions then --e.g. channel == 0 blockRadioEvent = true setRadioChannel(0) end end)
  14. You can't move default HUD to another place, instead you need to disable default one and create your own using dxDraw functions. You can use this resource https://community.multitheftauto.com/index.php?p= ... ils&id=807 Just change dxDraw positions in the script to your preferred.
  15. There is no fix now. Wait for 1.1 release.
  16. The point is you need to use different names or it will cause that error. headShots for counting and textHeadshots for text display.
  17. headShots:text("HeadShots#FF7256: [ #ffffff"..tostring(headShots).." #FF7256]") change to textHeadshots:text("HeadShots#FF7256: [ #ffffff"..tostring(headShots).." #FF7256]")
  18. You can not send messages to other clients using client-side outputChatBox, you can only trigger server events and message other players that way.
  19. You can't set aim target for local player, so if you want to shoot while in First Person view, you need a work-around. When aiming disable your FP script and use following local x,y,z = getElementPosition( getLocalPlayer() ) CamFixBody = createObject (983, x, y, z ) attachElements ( CamFixBody, getLocalPlayer(), 0, -0.1, 0.45, 90, 0, 90) setElementAlpha( CamFixBody, 0) setTimer ( setElementAlpha,1000, 1, getLocalPlayer(), 0) This will do well, however, localPlayer should be made then invisible. Also you need to check 'weapon_aim' state and switch scripts when state changes (from your to this work-around piece and vice versa)
  20. You can remove command 'register' from admin resource. 'Login' is hardcoded however. I would recommend you to create login GUI.
  21. There is no function like that client-side, but instead you can use setElementVelocity as work-around: local speed = 50 function limitSpeed() local myveh = getPedOccupiedVehicle(getLocalPlayer()) local vx,vy,vz = getElementVelocity(myveh) if getSpeed(vx,vy,vz) > speed then setElementVelocity(myveh,vx/1.05,vy/1.05,vz/1.05)--apply smooth speed limit end end addEventHandler('onClientRender',getRootElement(),limitSpeed) function getSpeed( x,y,z ) return math.sqrt(x^2 + y^2 + z^2) * 161 end
  22. Buffalo

    No-swear...

    function oyestfu(msg, lolT) _G["cancelEvent"]() for i,v in ipairs(badman) do local s,e = string.find(string.lower(msg), v) if s then msg = string.sub(msg,1,s).."<I_Love_You>"..string.sub(msg,e,string.len(msg))) end end r,g,b = getPlayerNametagColor(source) outputChatBox(getPlayerName(source)..": "..msg, root, r,g,b) end should fix capitals missing
  23. Just take it into account that coord values can be negative ^^ Try to subtract both values, so from the result you'll imagine easier how its working.
×
×
  • Create New...