Jump to content

IIYAMA

Moderators
  • Posts

    6,063
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. You are using the wrong event, > "onPlayerJoin".
  2. Why export? why don't you make your own one: https://wiki.multitheftauto.com/wiki/IsVoiceEnabled https://wiki.multitheftauto.com/wiki/Se ... roadcastTo https://wiki.multitheftauto.com/wiki/Se ... IgnoreFrom and as events: https://wiki.multitheftauto.com/wiki/OnColShapeHit https://wiki.multitheftauto.com/wiki/OnColShapeLeave and just 1 local timer: (to check if this player is still in the colshape, sometimes onColShapeLeave doesn't got triggered because of the lagg) https://wiki.multitheftauto.com/wiki/SetTimer and of course tables, ram fasted thing in the world.
  3. Something that makes it easier to apply textures to objects. Because I still don't understand shaders, I love lua but .fx doesn't make any sense in my opinion.
  4. Unfortunately when you change health of a player the same moment he got damaged, the damage doesn't got cancelled. I don't know why, but this is the way it works..... try this: Client local damageThePlayer = function () local newHealth = getElementHealth(localPlayer)-1 if newHealth > 0 then setElementHealth(localPlayer,newHealth) else setElementHealth(localPlayer,0) end end addEventHandler ( "onClientPlayerDamage",localPlayer, function () if getElementModel ( localPlayer ) == 9 then cancelEvent() setTimer(damageThePlayer,50,1) end end) The delay is 50 ms.
  5. You wear the correct skin? and you test it on a real player?
  6. You can try this at client side: local timer local fuelFunction = function (vehicle) if isElement(vehicle) then local actualFuel = tonumber(getElementData ( vehicle, "fuel" )) or 0 if actualFuel >= 1 then setElementData ( vehicle, "fuel", actualFuel - 1 ) outputChatBox ( "Fuel: " .. actualFuel, 255, 255, 255, false ) elseif actualFuel <= 0 then killTimer ( timer ) setVehicleEngineState ( vehicle, false ) end end end addEvent ( "useFuel", true ) local usingFuel = function ( ) local vehicle = getPedOccupiedVehicle (localPlayer) local timerCheck = isTimer ( timer ) if vehicle then local engine = getVehicleEngineState ( vehicle ) if engine then local actualFuel = tonumber(getElementData ( vehicle, "fuel" )) or 0 if not timerCheck and actualFuel >= 1 then timer = setTimer ( fuelFunction, 2000, 0,vehicle) elseif actualFuel <= 0 then if timerCheck then killTimer ( timer ) end setVehicleEngineState ( vehicle, false ) end elseif timerCheck then killTimer ( timer ) end elseif timerCheck then killTimer ( timer ) end end addEventHandler ( "useFuel", root, usingFuel )
  7. You can also script destruction by moving objects in to the ground after they got hit, maybe some explosions.
  8. If you want that, you have to give every player a blip and use this function to manage and reduce the amount of elements: https://wiki.multitheftauto.com/wiki/Se ... tVisibleTo
  9. Learn lua ftw! Especially tables, that is the one thing you need to make clean fast systems.
  10. You can do it as solidsnake said, But I will recommend you to create it at client side cause: - Reduce amount of elements at serverside. - His own created blips don't have to be deleted. - And especial easier to manage.
  11. This is at least one mistake. for blipIndex, blipValue in pairs ( blipy ) do if blipValue == blip then destroyElement ( blip ) break end end
  12. This event is called when player shoots a weapon. This does not trigger for projectiles based, or melee weapons. Also note that this event is only triggered for players nearby the local player's camera. This is due to elements far away being streamed out. People can't read? The only event that supports Molotov thingy is: https://wiki.multitheftauto.com/wiki/On ... leCreation
  13. Some can work with tables and some (aymeness81) people can't,
  14. You created an infinity, that never got killed. Players are going to be rich forever even if he started another job. After the player leaves, the playersb don't exist and your server got filled up with erros. etc.
  15. Something that have to fit in the other code..... I don't define mon cause it is in his own function, so if that is within his function block there is no reason to define it in my code. It will remain local with the timer till the timer stops.
  16. setTimer( givePlayerMoney, 1200000, 300, playersb, mon ) 1200000 / 1000 = 1200 sec 1200 / 60 = 20 minutes timer This is amount is correct? local bodyGuardTimers = {} bodyGuardTimers[playersb] = setTimer(function () if isElement(playersb) then givePlayerMoney( playersb, mon ) outputChatBox("Here is your payement.You can continue protecting to earn more. You got $ "..mon, playersb, 255, 255, 0 ) else local timer = bodyGuardTimers[playersb] if isTimer ( timer ) then killTimer ( timer ) end bodyGuardTimers[playersb] = nil end end,1200000, 300)
  17. np. Good luck with your script.
  18. You can try to use: setElementPosition(element,getElementPosition(element)) after you detach it.
  19. It must work unless it got overwritten. Note: After you set the vehicle handling only new vehicles will have this, not the old ones.
×
×
  • Create New...