Jump to content

Gr0x

Members
  • Posts

    109
  • Joined

  • Last visited

Everything posted by Gr0x

  1. Gr0x

    SOLVED

    onClientResourceStop does trigger, but it passes a remote player element, so you have to set the second argument of addEvent to true if you pass it to the server, like this addEvent("potato",true)
  2. Don't let them change it when they are alive. if getElementData(playerElement,"state") ~= "alive" then --your code end
  3. You forgot about the second argument of outputChatBox. outputChatBox("Failed No Message",player)
  4. He cleaned it up, which is useful. You should say thanks to that guy instead of complaining. Btw yeah, it's okay.
  5. Gr0x

    Spawn Menu

    Edit the .map file.
  6. Gr0x

    Q About GUI

    He did. You asked for functions, not for events. OnClientMouseEnter OnClientMouseLeave
  7. Gr0x

    SetGroupData

    Where should i know? Post the setGroupData function, and the event which triggers this if you need further help.
  8. Gr0x

    SetGroupData

    Where should we know what is the syntax of setGroupData, etc without you posting them? Don't wait for answers if you don't post the main function that you have the problem with.
  9. Gr0x

    onplayerban

    You can't get the account of a ban element, only of a player element. To do it, you have to find a way. (Like i said, set the reason to the account name.)
  10. Gr0x

    onplayerban

    Well, i won't make this one for you (I don't have time atm, sorry), but if you are using 1.4, you can use setBanReason to set the ban reason to the account name of the banned player, and use the onUnban event, get the reason with getBanReason and set the accountdata to false. There might be a much easier solution, but i can't think about it atm.
  11. Gr0x

    onplayerban

    You edited the post 1 minute after i posted my code, first you said that it didn't work.
  12. Gr0x

    onplayerban

    function outputBan () account = getPlayerAccount(source) if account and not isGuestAccount(account) then setAccountData(account,"AccountBanned",true) outputChatBox("The account has been banned",root,255,0,0) end end addEventHandler ( "onPlayerBan", getRootElement(), outputBan ) addEventHandler("onPlayerLogin", root, function(_,account) if getAccountData(account,"AccountBanned") == true then banPlayer ( source, false, false, true, getRootElement ( ), 'You have been banned',0 ) end end)
  13. You're welcome. If you need any help with scripts on your map, feel free to write me a PM.
  14. From the mta wiki: Note: Vehicles (and other elements) created client-side are only seen by the client that created them, [b]aren't synced and players cannot enter them[/b]. They are essentially for display only. You have to trigger a server event to create the vehicles server-sided.
  15. deletedMarkers = 0 addEventHandler ("onClientMarkerHit", root, function (player) deletedMarkers = deletedMarkers+1 destroyElement(source) amount = #getElementsByType ("marker")+deletedMarkers hitCheckpoints = hitCheckpoints + 1 result = amount - hitCheckpoints outputChatBox (result.. " checkpoints to go") if result == 0 then outputChatBox (getPlayerName (player):gsub("#%x%x%x%x%x%x","").." has won the race.", 255, 255, 255) end end )
  16. <script src="guicommand.lua" type="client" />
  17. Oh well. You are right. I'm sorry, i totally forgot about it.
  18. aircraftModels = { 592, 577, 511, 548, 512, 593, 425, 520, 417, 487, 553, 488, 497, 563, 476, 447, 519, 460, 469, 513 } function isAircraft(elem) if getElementType(elem) == "vehicle" then for q,w in pairs(aircraftModels) do if tonumber(getElementModel(elem)) == tonumber(w) then return true end end end return false end Add this code somewhere in your script, and use isAircraft(hitElement) in the if statement where you want it. You should also delete the "and not isPedInVehicle(hitElement)" part at the start to make this work.
  19. Gr0x

    Help sound

    You're welcome.
  20. Gr0x

    Help sound

    addEventHandler( "onClientMouseEnter", getRootElement(), function () if source == guielement then playSound(soundfile,false) end end ) guielement = The button, which you have to hover to play the sound soundfile = The file name (with extension)
  21. function globalMessage(source, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(source) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Admin" ) ) then outputChatBox("#ad515a[Admin]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) -- You wrote Global here, but i think you wanted Admin. return end if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) then outputChatBox("#ad515a[Moderator]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) return end if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#ad515a[superModerator]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) return end outputChatBox("#ad515a[Global]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) end addCommandHandler("global", globalMessage)
  22. addEventHandler ( "[b]onResourceStart[/b]", getResourceRootElement ( getThisResource () ), createTheGate ) It's already server-side, he used server-side event, and it worked. He only forgot the "player" from setTimer, i think.
×
×
  • Create New...