Jump to content

AJXB

Members
  • Posts

    367
  • Joined

  • Last visited

Everything posted by AJXB

  1. AJXB

    mute problem

    Many ways to do that, but you can just go on the wiki and look for an ACL function that checks that. I can tell you what function that is but you should spend some time
  2. You can just make a function rather than making an event since they're both on the server side. function onZombieWasted (attacker) if (isElement( attacker )) then givePlayerMoney(attacker,math.random(75,150)) -- default 50$ end end function deanimated( ammo, attacker, weapon, bodypart ) if (attacker) then if (getElementType ( attacker ) == "player") and (getElementType ( source ) == "ped") then if (getElementData (source, "zombie") == true) then local oldZcount = getElementData ( attacker, "Zombie kills" ) if oldZcount ~= false then setElementData ( attacker, "Zombie kills", oldZcount+1 ) else setElementData ( attacker, "Zombie kills", 1 ) end onZombieWasted ( attacker ) end end end end addEventHandler("onPedWasted", resourceRoot, deanimated) You might wanna add a check to the weapon used, to avoid abuse
  3. AJXB

    hello

    You can find it at community.multitheftauto.com
  4. AJXB

    Xml

    You should set an xmlFile variable
  5. AJXB

    mute problem

    Line 4 is checking for data related to the player, It's there because the script is taken from another game mode, or considered connected to other scripts. Replace line 4 with this line and post any errors you have if (isElement( thePlayer )) then Next time, please write your own code
  6. How about you show us how are you triggering that event?
  7. createMarker() math.random() createVehicle() warpPedIntoVehicle() -- You can find examples on community.multitheftauto.com
  8. AJXB

    mute problem

    Did you verify all that getElementData() you're doing on line 4 ?
  9. It's even more useless than a forum, it's just a theme And how much are you thinking this is worth?
  10. Off-topic: Activate Windows On-topic: You might wanna elaborate, at least tell us what forum software that is.
  11. AJXB

    help me

    English, please
  12. the pistol fires 1 projectile (bullet) and the sawed-off fires many? Not sure, but it will depend on where are you shooting the ped too. maybe someone else can be more of a help
  13. Try to fetchRemote another type of file, maybe a .lua, what does it return?
  14. outputConsole(responseData) What does this return in your console?
  15. in your "myCallback" function, try to output "responseData ", what is it? I'm sorry, I might not be much of a help
  16. He did, that's how he found the errors above. I think he removed `addCommandHandler` and changed the player instance
  17. Post your full code if it's different in any way than the code above.
  18. First of all, you need to put a plan on how the script works. then go on the Wiki and plan the functions you will use. Then start making the code using Wiki & the community.
  19. Try this: -- Server Side damageTimers = {} function handlePlayerDamage ( attacker, weapon, bodypart, loss ) if (attacker) then -- Check if an attacker exists, you might wanna add a check to see if it's a valid player, also check the attacked player (source) if isTimer(damageTimers[source]) then -- Check if there is already a timer to reset the state of that player, happens when the player is damaged again before the 20 seconds are over killTimer(damageTimers[source]) -- Kill the old timer and continue to make a new one end setElementData(source,'damaged',true) -- Mark the player as damaged within the last 20 seconds damageTimers[source] = setTimer( -- Make a timer, we used a table damageTimers[] function() setElementData(source,'damaged',false) -- Mark the player as not damaged within the last 20 seconds AFTER the timer expires (20 seconds) end, 20*1000, 0 ) end end addEventHandler ( "onPlayerDamage", getRootElement (), handlePlayerDamage ) -- addEventHandler to all players
  20. Try this: -- Client window1 = guiCreateWindow(455, 178, 710, 532, "", false) editUsername = guiCreateEdit(167, 108, 361, 40, "", false, window1) editPassword = guiCreateEdit(170, 197, 358, 36, "", false, window1) btnLogin = guiCreateButton(9, 434, 691, 43, "Login", false, window1) btnClose = guiCreateButton(14, 486, 686, 36, "Close", false, window1) guiSetVisible(window1, true) showCursor(true) guiWindowSetSizable(window1, false) function closeGui() if btnClose == source then guiSetVisible(window1, false) showCursor(false) end end addEventHandler("onClientGUIClick", root, closeGui) -- changed "root" function logToServer() if (source == btnLogin) then -- Check button clicked local account = guiGetText(editUsername) local password = guiGetText(editPassword) local name = getPlayerName(getLocalPlayer()) triggerServerEvent("test", localPlayer, account, password, name) end end addEventHandler("onClientGUIClick", root, logToServer) -- changed "root" -- Server function myMoney(account, password, name) outputChatBox(name); logIn (source, account, password) end addEvent("test", true) addEventHandler("test", root, myMoney)
  21. Yep, and I still stand by word. the GUI sometimes calculates the actual button element a bit larger than the actual displayed unit, or since it's attached to the GUI window, it sometimes confuses that as well. So that means when you click outside of a button, it triggers the button. Feel free to use any method you like, but what I use to avoid any type of issue is the first solution.
  22. Compatibility issues if you put the GUI element in the event handler
  23. You made a topic to ask someone to fix "your" script, which would be fixed if you changed false to true?
  24. AJXB

    Convert Time

    if (hour > 12) then hour = hour-12 end Isn't it this simple? From 00:00 to 12:00 that's morning, so it's AM, after 12:00 it's all PM
×
×
  • Create New...