-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
myTable = { a = {test = "ok"} } myTable.b = {} myTable.b.test = myTable.a.test outputChatBox(tostring(myTable.a.test)) outputChatBox(tostring(myTable.b.test)) no it isn't, cause you can't index something that hasn't been created yet. myTable = { -- not yet created } -- created
-
Just the only way to make it faster now is by changing it to a spraycan. > flag 0x000400 Read that list carefully and see what isn't possible yet.
-
You can also choose for onClientRender or onClientPreRender. Then you simply use your own index without a loop.
-
then you may have to use a custom dx name tag.
-
It seems there is no problem. But maybe you can better use setPlayerName instead of setPlayerNametagText . https://wiki.multitheftauto.com/wiki/SetPlayerName local ListSerial = { ["D959022732DB64516435467F3D1BF5F4"]="Sojn", ["A5331B0D0A5919DBA1C19B1A278E68D4"]="d7om", ["C57CA400888FD05D058D04571B4FA912"]="iMr.3a[Z]eF", ["2D7A67D844738FEA7562CEDBE812A3E2"]="Mizo" } addEventHandler('onPlayerJoin', root, function ( ) local serialData = ListSerial[getPlayerSerial( source )] if serialData then setPlayerName ( source, serialData) setPlayerNametagColor ( source, 255, 0, 0 ) end end)
-
ah yes, updated. let me test it.
-
local ListSerial = { ["D959022732DB64516435467F3D1BF5F4"]="Sojn", -- ["A5331B0D0A5919DBA1C19B1A278E68D4"]="d7om", -- ["1715B68D93F4CDF04BAA065F5D4D14B2"]="iMr.3a[Z]eF", ["2D7A67D844738FEA7562CEDBE812A3E2"]="Mizo" } addEventHandler('onPlayerJoin', root, function ( ) local serialData = ListSerial[getPlayerSerial( source )] if serialData then setPlayerNametagText ( source, serialData ) setPlayerNametagColor ( source, 255, 0, 0 ) end end)
-
local ListSerial = { ["D959022732DB64516435467F3D1BF5F4"]=true, -- Sojn ["A5331B0D0A5919DBA1C19B1A278E68D4"]=true, -- d7om ["1715B68D93F4CDF04BAA065F5D4D14B2"}=true, -- Me ["2D7A67D844738FEA7562CEDBE812A3E2"]=true -- Mizo } addEventHandler('onPlayerJoin', root, function ( ) if ListSerial[getPlayerSerial( source )] then setPlayerNametagText ( source, "????" ) setPlayerNametagColor ( source, 255, 0, 0 ) end end)
-
You are using the wrong event, > "onPlayerJoin".
-
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.
-
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.
-
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.
-
You wear the correct skin? and you test it on a real player?
-
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 )
-
You have 2 maps in one?
-
You can also script destruction by moving objects in to the ground after they got hit, maybe some explosions.
-
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
-
Learn lua ftw! Especially tables, that is the one thing you need to make clean fast systems.
-
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.
-
This is at least one mistake. for blipIndex, blipValue in pairs ( blipy ) do if blipValue == blip then destroyElement ( blip ) break end end
-
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
