Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. IIYAMA

    Problem

    local myVictimData = {} local timerRunning = false --local player = source reduce ppppiiieeppp bugs.... function victim_def(attacker) if attacker and attacker ~= source and getElementType ( attacker ) == "ped" then local player = source myVictimData[player]={} timerRunning = true if not isTimer(dmgtimer) then dmgtimer = setTimer( damagetimer, 200, 0) end end end addEventHandler("onPlayerDamage", getRootElement(), victim_def) function damagetimer () if timerRunning == false then if isTimer(dmgtimer) then killTimer (dmgtimer) end return end local activetimer = 0 for k,player in ipairs(myVictimData) do activetimer = activetimer +1 local health = getElementHealth(player) if health > 0 then setElementHealth(player, health-1) else killPed(player) end end if activetimer == 0 then timerRunning = false end end function resourceStart () dmgtimer = setTimer( damagetimer, 200, 0) end addEventHandler ( "onResourceStart", resourceRoot, resourceStart ) function on_Player_Quit() -- remove him from the table when he leaves local player = source myVictimData[player] = nil end addEventHandler ( "onPlayerQuit", getRootElement(),on_Player_Quit) function on_Player_Wasted () -- remove him from the table when he get killed local player = source; myVictimData[player] = nil end addEventHandler ( "onPlayerWasted", getRootElement(),on_Player_Wasted)
  2. IIYAMA

    Problem

    test it again. If it doesn't work, check with outputDebugString("") what went wrong when you don't have any erros.
  3. IIYAMA

    Instable ping.

    My qwestion is: do server "get" functions cause client ping lagg?
  4. IIYAMA

    Problem

    Try both pls: local myVictimData = {} local timerRunning = false --local player = source reduce ppppiiieeppp bugs.... function victim_def(attacker) if attacker and attacker ~= source and getElementType ( attacker ) == "ped" ) then local player = source myVictimData[player]={} timerRunning = true if not damagetimer then setTimer( damagetimer, 200, 0) end end end addEventHandler("onPlayerDamage", getRootElement(), victim_def) function damagetimer () if timerRunning == false then killTimer (damagetimer) return end local activetimer = 0 for k,player in ipairs(myVictimData) do activetimer = activetimer +1 local health == getElementHealth(player) if health > 0 then setElementHealth(player, health-1) else killPed(player) end end if activetimer == 0 then timerRunning = false end end function resourceStart () setTimer( damagetimer, 200, 0) end addEventHandler ( "onResourceStart", resourceRoot, resourceStart ) function on_Player_Quit() -- remove him from the table when he leaves local player = source myVictimData[player] = nil end addEventHandler ( "onPlayerQuit", getRootElement(),on_Player_Quit) function on_Player_Wasted () -- remove him from the table when he get killed local player = source; myVictimData[player] = nil end addEventHandler ( "onPlayerWasted", getRootElement(),on_Player_Wasted)
  5. Can "get/is" server functions cause instable ping? Possible ? Because I use "3" t/m "5" get/is functions: (2 players, hitelement is also player) player and attacker isPedInVehicle ( attacker ) getElementPosition(attacker) getElementPosition(hitElement); getElementRotation ( attacker ) ( getControlState ( attacker,"fire" ) ) getElementType(attacker)=="player" getElementType(hitElement) =="player" isPedChoking ( hitElement ) getPedRotation(hitElement) getPlayerPing(hitElement) isPedDucked ( hitElement ) isElement(player) -- not always getPedContactElement ( player )-- not always getPlayerTeam(attacker) -- not always getPlayerTeam(player)-- not always getPedArmor(player) -- not always Do they cause client lagg? Note: the script that use these functions get executed very much. at last a set function: setElementHealth()
  6. It's always good to come with another (good)solution, because the "createFire" function is useless. ( using an object as fire, it makes it possible to delete it and won't give so much trouble with teamkilling etc.) I don't think that is stupid because preventing is better than rewriting. This my opinion. Note: I will mind that, thx I let your discussion to continue, if it is still on.
  7. Maybe you can change a object with a mod? (dunno if possible with currently mods, but it should be "true")
  8. About that keypad thingy, you can use OnClientClick and check the distance from the X,Y,Z from the OnclientClick and the object it self and it should work. That means you click with your mouse on the button. Or https://wiki.multitheftauto.com/wiki/OnColShapeHit, to enable a key to activate the keypad. onColShapeLeave to remove the bind. Next to that you can check the distance from the player and compare that with the keypad so it will only work when you close. At last you can use animation to finish it. What's wrong with the /quit ? What else must happen when you write that? and no your English isn't bad, but your explanation is. https://wiki.multitheftauto.com/wiki/AddCommandHandler
  9. ok, which encoder do you use?
  10. But why this encoding? I won't see the difference.
  11. I have one tab called "codering", for me it is not encoding(dutch version but it should not really matter..). In that tab there is UTF-8 without BOM converting. When I set him to "UTF-8 without BOM converting", nothing happend, the script does not have any errors. Do you have some plugins or?
  12. lol, I think your question isn't correct, Mta can do everything that samp can. Only sometimes you have to make it your self. "Yes but how to do with button on the wall?" hmm? You mean a button to click (3d button) so something happens? You mean this: https://wiki.multitheftauto.com/wiki/OnClientClick wikimta onclientclick Move object: https://wiki.multitheftauto.com/wiki/MoveObject
  13. IIYAMA

    Central Time

    See 3ήẰÐ his script, that's shows your own time. (not my lines, just for you to know and not stolen, from the community*) But: local realtime=string.format("%02d-%02d", getRealTime().hour, getRealTime().minute) outputChatBox(string.char(string.byte(realtime, i,i)))
  14. IIYAMA

    Central Time

    server function getthetime(player) local hour, minutes = getTime() local Thetimenow[1] = hour, minutes triggerClientEvent ( "store_the_time", getRootElement(), Thetimenow ) end addCommandHandler("whatisthetime", getthetime) --or local local Thetimenow[1] = getTime() client local hour, minutes = 0,0 addEvent( "store_the_time", true ) addEventHandler( "store_the_time", getRootElement(), ready_to_store ) function ready_to_store (Thetimenow) hour, minutes = Thetimenow[1] end GetTime or function getthetime(player) triggerClientEvent ( "store_the_time", getRootElement(), getTime() ) end addCommandHandler("whatisthetime", getthetime) local hour, minutes = 0,0 addEvent( "store_the_time", true ) addEventHandler( "store_the_time", getRootElement(), ready_to_store ) function ready_to_store (hour2, minutes2) hour, minutes = hour2, minutes2 end your question is incorrect, or I don't know... I don't get it... lol 3ήẰÐ was first, his sample is better.
  15. Nope, Because change .txds is like adding mods to objects. TXD isn't generated by a onClientRender function, but will replace it's object colours. But the directX functions give use hope, to do the impossible. Write "dx" in wiki mta and you will find other directx functions. https://wiki.multitheftauto.com/wiki/DxCreateShader
  16. ok, thx
  17. You have a sample of loadstring? local file = fileOpen( ":resource/file.ext" ); if ( file ) then loadstring( fileRead( file, fileGetSize( file ) ) )(); end fileClose( file ); and will it matter if you are running a windows or linux server?
  18. 3ɑsн8 ɑʟsнɾq, is a very good helper at the forum. When somebody got a problem he is always tries to help them, if they understand a little lua. He helped me circa 3/5 times, successful. I vote for 3ɑsн8 ɑʟsнɾq, (if my vote count)
  19. Je hebt te veel .lua gescript en je gaat aan je leraar hulp vragen omdat je er niet uit komt.
  20. Check when you start a map, not a gamemode or script. https://wiki.multitheftauto.com/wiki/OnResourceStart I need to use the "type" written in the meta* function resourcecheck ( res ) end addEventHandler ( "onResourceStart", getRootElement(), resourcecheck ) Must I use the resource "mapmanager" to do that?
  21. https://wiki.multitheftauto.com/wiki/SetLowLODElement This works 100% for me. Just set the elements you use at 300* or all objects you even can think off. Note:(client) for i = 1, 10000 do -- put all objects between 1 t/m 10000 in a loop engineSetModelLODDistance ( i, 300 ) --force them to load. end Don't work for ped's, cars and I think also not so good for interiors.
  22. Just download another version..... There are many versions.
  23. yes, but it is still wasted of bandwidth. It is better to store it in a table. and the strange thing aboth all that the element data never will be set in the script except the element data already exist.
×
×
  • Create New...