Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. IIYAMA

    loadstring

    Will loadstring execute the code ones and then it is gone? O_o
  2. IIYAMA

    loadstring

    But how can I destroy this string? Because if I load this function: loadstring("function thisFunction() outputChatBox(\"thisFunction\") end") It will stay active.
  3. IIYAMA

    loadstring

    Does anybody knows how I can unload a loaded string? Or at least disable it. Advance stuff, pls only reply if you know what the loadstring function does.
  4. By cancelling this effect. https://wiki.multitheftauto.com/wiki/OnClientPedChoke addEventHandler( "onClientPedChoke", root, function (weapon) if weapon == 41 then cancelEvent( ); end end ) You can also cancel the onClientPlayerDamage event with the same result.
  5. But he isn't using onClientWeaponFire but onClientPlayerWeaponFire. It can be both, source and localPlayer.
  6. client = always the playerElement who sends the data. source = the element that is sending with the event. >triggerServerEvent("onPlayerFilesDownloaded",localPlayer)< But afaik there aren't much people in mta who are able to send events without using a script. Maybe the development team can. I am using source as player too, unless I am sending another element as source.
  7. if CursorX [color=#0040FF]>[/color] [color=#FF0000]0.07426[/color] and CursorY > 0.8098 then if CursorX [color=#0040FF]<[/color] [color=#FF0000]0.01367[/color] and CursorY < 0.8971 then setElementData(getLocalPlayer(), "Class", "Engineer") outputConsole("Engineer") end end Take a closed look at that. It must be higher then 0.07426 and lower then 0.01367, which isn't possible.
  8. IIYAMA

    Vehicles

    @Atton local myVehicleTable = {} function createCar (thePlayer) local car = createVehicle(411,0,0,14) outputChatBox("TRUEm",thePlayer) myVehicleTable[#myVehicleTable + 1]=car-- save inside a table end addCommandHandler("make",createCar) function destroyAllVehicles (thePlayer) outputChatBox("remove",thePlayer) for i=1,#myVehicleTable do local vehicle = myVehicleTable[i] if isElement(vehicle) then destroyElement(vehicle) end end myVehicleTable = {}-- reset end addCommandHandler("remove",destroyAllVehicles) I and you made a mistake with not defining the player. But it should also work with it defining it wrong, not sure why it didn't work. Try this again, it works for 100% /remove @Anubhav Why don't you fix my code instead of rewrite it? What is the use of that anyway... You made a mistake with your table.insert so your code will no work. and you even took my/Atton mistakes with it.
  9. IIYAMA

    Vehicles

    local myVehicleTable = {} function createCar () local car = createVehicle(411,0,0,14) outputChatBox("TRUEm",thePlayer) myVehicleTable[#myVehicleTable+1]=car-- save inside a table end addCommandHandler("make",createCar) function destroyAllVehicles () for i=1,#myVehicleTable do local vehicle = myVehicleTable[i] if isElement(vehicle) then destroyElement(vehicle) end end myVehicleTable = {}-- reset end addCommandHandler("destroy",destroyAllVehicles)
  10. IIYAMA

    mysql question

    I have no knowledge of mysql, only lua.
  11. IIYAMA

    Random Maps

    Before you let somebody lock it, you also can use mapmanager. function setNextRound () local mapmanager = getResourceFromName ( "mapmanager" ) if mapmanager then local maps = call (mapmanager,"getMapsCompatibleWithGamemode",thisResource) if maps then call (mapmanager,"changeGamemodeMap",maps[math.random(#maps)]) end end end
  12. IIYAMA

    mysql question

    Depends how strong the server is, but yes it will use more memory then normal.
  13. net of jij zo duidelijk bent.... er zijn heel veel panels/scripts/gamemodes namelijk.
  14. Het "unkown" script aanpassen?
  15. client -- client -- function policeSirens( ) local occveh = getPedOccupiedVehicle ( localPlayer ) if occveh then local id = getElementModel ( occveh ) -- theVehicle if id == 596 or id == 597 then triggerServerEvent("vehicleSirens",occveh) end end end server -- server -- addEvent("vehicleSirens",true) addEventHandler("vehicleSirens",root, function () if isElement(source) then setVehicleSirens ( source, 7, -0.800, -2.849, 0.050, 60, 118, 224, 255, 255 ) addVehicleSirens ( source, 7, 3, true, false, true, false ) end end) @Dzsozi There are warnings. /debugscript 3 to see them. And next time put them at your post.
  16. Open the resource parachute and there you will find everything you need to know. The parachute from gta can't be used. That's why mta created the parachute resource to make it possible and synced.
  17. Indeed, Einheit-101. But there a lot of ways to do it. https://wiki.multitheftauto.com/wiki/Ge ... enPosition https://wiki.multitheftauto.com/wiki/ProcessLineOfSight https://wiki.multitheftauto.com/wiki/GetBoundKeys getPedOccupiedVehicle setElementHealth getElementHealth Event: Etc. People there is a lot possible with mta...
  18. It stays local at that block of the code. a= 10 if a then local a = 3 a = 3 end outputChatBox(a)--10 But before you wrote the local: a= 10 if a then a = 3 local a = 3 end outputChatBox(a)--3
  19. It is maybe also handy if you check if the ped still does exist. if isElement(ped) then or you may will have trouble when the ped somehow is deleted.(by another script)
  20. Well mister, 8 of the 10 people that use this forum(scripting section) don't understand a damn about it. Because they learn lua via mta and not via lua sites(like: http://lua-users.org/) There isn't enough information there to know what ways there are.
  21. @mrbrutus1467 and all who don't understand.... Now stringKey1 have to be a variable, which isn't defined. It is: local exampleTable = { stringKey1 = { "Value 1", "value 2", "value 3" } } or local exampleTable = { ["stringKey1"] = { "Value 1", "value 2", "value 3" } } or with the variable stringKey1 but defined. local stringKey1 = "stringKey1" local exampleTable = { [stringKey1] = { "Value 1", "value 2", "value 3" } }
  22. So anyone advise? Can't you read or are you blind? Or to lazy to follow somebody his advise, so you ask it again to get the same advice?
  23. IIYAMA

    Is this ok?

    This will count down from the highest array, and check if they are nil/false and count one down till it's found it's target. local myVariable for i=#myTable,1,-1 do -- counts down till 1. local variable = myTable[i] if variable then myVariable = variable break end end If you use they array I will recommend you to use table.remove, so you won't have trouble with empty places.
  24. IIYAMA

    [Solved]

    Then use castillo his exp table at clientside or what ever.
×
×
  • Create New...