Jump to content

Bean666

Members
  • Posts

    732
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Bean666

  1. all of the weapons, the original code is not just for weapons and it's messy and not so optimized, so behind that code has all sorts of getIDs and element datas lol, I just need the weapon save optimized, since that flamethrower save is buggy. but anyway here's the full one: function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "money") if (accountData) then local oldplayer = getAccountData (theCurrentAccount, "oldplayer") local playerMoney = getAccountData (theCurrentAccount, "money") local playerSkin = getAccountData (theCurrentAccount, "skin") local playerHealth = getAccountData (theCurrentAccount, "health") local playerArmor = getAccountData (theCurrentAccount, "armor") local playerX = getAccountData (theCurrentAccount, "x") local playerY = getAccountData (theCurrentAccount, "y") local playerZ = getAccountData (theCurrentAccount, "z") local playerInt = getAccountData (theCurrentAccount, "int") local playerDim = getAccountData (theCurrentAccount, "dim") local playerTeam = getAccountData (theCurrentAccount, "Team") local playerWeaponID0 = getAccountData (theCurrentAccount, "weaponID0") local playerWeaponID1 = getAccountData (theCurrentAccount, "weaponID1") local playerWeaponID2 = getAccountData (theCurrentAccount, "weaponID2") local playerWeaponID3 = getAccountData (theCurrentAccount, "weaponID3") local playerWeaponID4 = getAccountData (theCurrentAccount, "weaponID4") local playerWeaponID5 = getAccountData (theCurrentAccount, "weaponID5") local playerWeaponID6 = getAccountData (theCurrentAccount, "weaponID6") local playerWeaponID7 = getAccountData (theCurrentAccount, "weaponID7") local playerWeaponID8 = getAccountData (theCurrentAccount, "weaponID8") local playerWeaponID9 = getAccountData (theCurrentAccount, "weaponID9") local playerWeaponID10 = getAccountData (theCurrentAccount, "weaponID10") local playerWeaponID11 = getAccountData (theCurrentAccount, "weaponID11") local playerWeaponID12 = getAccountData (theCurrentAccount, "weaponID12") local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "weaponAmmo0") local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "weaponAmmo1") local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "weaponAmmo2") local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "weaponAmmo3") local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "weaponAmmo4") local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "weaponAmmo5") local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "weaponAmmo6") local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "weaponAmmo7") local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "weaponAmmo8") local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "weaponAmmo9") local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "weaponAmmo10") local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "weaponAmmo11") local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "weaponAmmo12") setElementData(source, "selecting", nil) local role = getAccountData ( theCurrentAccount, "Class" ) setElementData ( source, "Class", role ) local occupation = getAccountData ( theCurrentAccount, "Occupation" ) setElementData ( source, "Occupation", occupation ) spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim) setPlayerMoney (source, playerMoney) setTimer (setElementHealth, 500, 1, source, playerHealth) setTimer (setPedArmor, 500, 1, source, playerArmor) setTimer (setPlayerWantedLevel, 500, 1, source, playerWanted) giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true) giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false) giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false) giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false) giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false) giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false) giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false) giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false) giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false) giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false) giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false) giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false) giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false) setCameraTarget (source, source) fadeCamera(source, true, 2.0) else fadeCamera(source, true, 2.0) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then local account = getPlayerAccount (source) if (account) then local role = tostring (getElementData ( source, "Class" )) setAccountData ( account, "Class", role ) local occupation = tostring (getElementData ( source, "Occupation" )) setAccountData ( account, "Occupation", occupation ) local x,y,z = getElementPosition (source) setAccountData (account, "money", tostring (getPlayerMoney (source))) setAccountData (account, "skin", tostring (getPedSkin (source))) setAccountData (account, "health", tostring (getElementHealth (source))) setAccountData (account, "armor", tostring (getPedArmor (source))) setAccountData (account, "oldplayer", "yes") setAccountData (account, "x", x) setAccountData (account, "y", y) setAccountData (account, "z", z) setAccountData (account, "int", getElementInterior (source)) setAccountData (account, "dim", getElementDimension (source)) setAccountData (account, "weaponID0", getPedWeapon (source, 0)) setAccountData (account, "weaponID1", getPedWeapon (source, 1)) setAccountData (account, "weaponID2", getPedWeapon (source, 2)) setAccountData (account, "weaponID3", getPedWeapon (source, 3)) setAccountData (account, "weaponID4", getPedWeapon (source, 4)) setAccountData (account, "weaponID5", getPedWeapon (source, 5)) setAccountData (account, "weaponID6", getPedWeapon (source, 6)) setAccountData (account, "weaponID7", getPedWeapon (source, 7)) setAccountData (account, "weaponID8", getPedWeapon (source, 8)) setAccountData (account, "weaponID9", getPedWeapon (source, 9)) setAccountData (account, "weaponID10", getPedWeapon (source, 10)) setAccountData (account, "weaponID11", getPedWeapon (source, 11)) setAccountData (account, "weaponID12", getPedWeapon (source, 12)) setAccountData (account, "weaponAmmo0", getPedTotalAmmo (source, 0)) setAccountData (account, "weaponAmmo1", getPedTotalAmmo (source, 1)) setAccountData (account, "weaponAmmo2", getPedTotalAmmo (source, 2)) setAccountData (account, "weaponAmmo3", getPedTotalAmmo (source, 3)) setAccountData (account, "weaponAmmo4", getPedTotalAmmo (source, 4)) setAccountData (account, "weaponAmmo5", getPedTotalAmmo (source, 5)) setAccountData (account, "weaponAmmo6", getPedTotalAmmo (source, 6)) setAccountData (account, "weaponAmmo7", getPedTotalAmmo (source, 7)) setAccountData (account, "weaponAmmo8", getPedTotalAmmo (source, 8)) setAccountData (account, "weaponAmmo9", getPedTotalAmmo (source, 9)) setAccountData (account, "weaponAmmo10", getPedTotalAmmo (source, 10)) setAccountData (account, "weaponAmmo11", getPedTotalAmmo (source, 11)) setAccountData (account, "weaponAmmo12", getPedTotalAmmo (source, 12)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
  2. it works perfectly, thank you but how can i apply it on my save accountdata stuff? cause' the format is kinda different, sarreh im kinda confused onSpawn= function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "money") if (accountData) then local playerWeaponID12 = getAccountData (theCurrentAccount, "weaponID7") local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "weaponAmmo7") spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim) giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false) setCameraTarget (source, source) fadeCamera(source, true, 2.0) else fadeCamera(source, true, 2.0) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then local account = getPlayerAccount (source) if (account) then setAccountData (account, "weaponID7", getPedWeapon (source, 7)) setAccountData (account, "weaponAmmo7", getPedTotalAmmo (source, 7)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
  3. No, the Editbox is made of "guiCreateEdit", basically a normal one. the Body yes, but the edit boxes are just normal ones, not a DX. https://imgur.com/ZyietHk
  4. Hi how to disable binds especially when on login panel, edit panels. I tried this code: addEventHandler("onClientResourceStart", getResourceRootElement(), function() guiSetInputMode("no_binds_when_editing") --Calls guiSetInputMode once and for all to not have to handle binds state dynamically end) and it does not work, or did I use it wrong, or I'm missing something, help appreciated.
  5. its fixed number, and btw thanks I would appreciate any help.
  6. tried it already, still doubles the hell out of it, i think its because the flamethrower has a unique ammo amount? @Tekken
  7. I have a script that saves weapon on death / reconnect, but the flamethrower ammo doubles! why? It works perfectly on all types of weapons, its just the flamethrower, is it because it's ammo is different? if so how do I fix it? Image of before & after: https://imgur.com/a/v2c1iXF local playerWeapons = { } addEventHandler ( "onPlayerWasted", root, function ( ) if ( not playerWeapons [ source ] ) then playerWeapons [ source ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( source, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( source, slot ) if ( ammo > 0 ) then playerWeapons [ source ] [ weapon ] = ammo end end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) if ( playerWeapons [ source ] ) then for weapon, ammo in pairs ( playerWeapons [ source ] ) do giveWeapon ( source, tonumber ( weapon ), tonumber ( ammo ) ) end end playerWeapons [ source ] = nil end )
  8. Bean666

    Not becoming admin

    hi recently, i bought a game server, but adding my username won't work, i aalready added my name in admin group, but once i login it doesn't give me rights neither an admin panel acl.xml: <acl> <group name="Everyone"> <acl name="Default"></acl> <object name="user.*"></object> <object name="resource.*"></object> </group> <group name="Moderator"> <acl name="Moderator"></acl> <object name="resource.mapcycler"></object> <object name="resource.mapmanager"></object> <object name="resource.resourcemanager"></object> <object name="resource.votemanager"></object> </group> <group name="SuperModerator"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> </group> <group name="Admin"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="RPC"></acl> <object name="resource.admin"></object> <object name="resource.webadmin"></object> <object name="resource.acpanel"></object> <object name="resource.script_editor"></object> <object name="user.illudota"></object> <object name="resource.guieditor"></object> <object name="resource.gui_editor"></object> </group> <group name="Console"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="RPC"></acl> <object name="user.Console"></object> </group> <group name="RPC"> <acl name="RPC"></acl> </group> <group name="MapEditor"> <acl name="Default"></acl> <acl name="MapEditor"></acl> <object name="resource.editor_main"></object> <object name="resource.edf"></object> </group> <group name="raceACLGroup"> <acl name="Default"></acl> <acl name="raceACL"></acl> <object name="resource.race"></object> </group> <group name="DevGroup"> <acl name="DevACL"></acl> </group> <group name="autoGroup_guieditor"> <acl name="autoACL_guieditor"></acl> <object name="resource.guieditor"></object> </group> <group name="autoGroup_gui_editor"> <acl name="autoACL_gui_editor"></acl> <object name="resource.gui_editor"></object> </group> <acl name="Default"> <right name="general.ModifyOtherObjects" access="false"></right> <right name="general.http" access="false"></right> <right name="command.start" access="false"></right> <right name="command.stop" access="false"></right> <right name="command.stopall" access="false"></right> <right name="command.gamemode" access="false"></right> <right name="command.changemode" access="false"></right> <right name="command.changemap" access="false"></right> <right name="command.stopmode" access="false"></right> <right name="command.stopmap" access="false"></right> <right name="command.skipmap" access="false"></right> <right name="command.restart" access="false"></right> <right name="command.refresh" access="false"></right> <right name="command.refreshall" access="false"></right> <right name="command.addaccount" access="false"></right> <right name="command.delaccount" access="false"></right> <right name="command.debugscript" access="false"></right> <right name="command.chgpass" access="false"></right> <right name="command.loadmodule" access="false"></right> <right name="command.unloadmodule" access="false"></right> <right name="command.reloadmodule" access="false"></right> <right name="command.upgrade" access="false"></right> <right name="command.mute" access="false"></right> <right name="command.crun" access="false"></right> <right name="command.srun" access="false"></right> <right name="command.run" access="false"></right> <right name="command.unmute" access="false"></right> <right name="command.kick" access="false"></right> <right name="command.ban" access="false"></right> <right name="command.banip" access="false"></right> <right name="command.unbanip" access="false"></right> <right name="command.reloadbans" access="false"></right> <right name="command.shutdown" access="false"></right> <right name="command.install" access="false"></right> <right name="command.aexec" access="false"></right> <right name="command.whois" access="false"></right> <right name="command.whowas" access="false"></right> <right name="command.aclrequest" access="false"></right> <right name="command.authserial" access="false"></right> <right name="command.reloadacl" access="false"></right> <right name="function.executeCommandHandler" access="false"></right> <right name="function.setPlayerMuted" access="false"></right> <right name="function.addAccount" access="false"></right> <right name="function.addBan" access="false"></right> <right name="function.setUnbanTime" access="false"></right> <right name="function.setBanAdmin" access="false"></right> <right name="function.setBanReason" access="false"></right> <right name="function.setBanNick" access="false"></right> <right name="function.removeBan" access="false"></right> <right name="function.removeAccount" access="false"></right> <right name="function.setAccountName" access="false"></right> <right name="function.setAccountPassword" access="false"></right> <right name="function.kickPlayer" access="false"></right> <right name="function.banPlayer" access="false"></right> <right name="function.getBans" access="false"></right> <right name="function.reloadBans" access="false"></right> <right name="function.setServerPassword" access="false"></right> <right name="function.getServerPassword" access="false"></right> <right name="function.callRemote" access="false"></right> <right name="function.fetchRemote" access="false"></right> <right name="function.startResource" access="false"></right> <right name="function.stopResource" access="false"></right> <right name="function.restartResource" access="false"></right> <right name="function.createResource" access="false"></right> <right name="function.copyResource" access="false"></right> <right name="function.addResourceMap" access="false"></right> <right name="function.addResourceConfig" access="false"></right> <right name="function.removeResourceFile" access="false"></right> <right name="function.setResourceDefaultSetting" access="false"></right> <right name="function.removeResourceDefaultSetting" access="false"></right> <right name="function.redirectPlayer" access="false"></right> <right name="function.aclReload" access="false"></right> <right name="function.aclSave" access="false"></right> <right name="function.aclCreate" access="false"></right> <right name="function.aclDestroy" access="false"></right> <right name="function.aclSetRight" access="false"></right> <right name="function.aclRemoveRight" access="false"></right> <right name="function.aclCreateGroup" access="false"></right> <right name="function.aclDestroyGroup" access="false"></right> <right name="function.aclGroupAddACL" access="false"></right> <right name="function.aclGroupRemoveACL" access="false"></right> <right name="function.aclGroupAddObject" access="false"></right> <right name="function.aclGroupRemoveObject" access="false"></right> <right name="function.refreshResources" access="false"></right> <right name="function.setServerConfigSetting" access="false"></right> <right name="function.updateResourceACLRequest" access="false"></right> <right name="function.shutdown" access="false"></right> <right name="function.setPlayerScriptDebugLevel" access="false"></right> <right name="general.adminpanel" access="false"></right> <right name="general.tab_players" access="false"></right> <right name="general.tab_resources" access="false"></right> <right name="general.tab_maps" access="false"></right> <right name="general.tab_server" access="false"></right> <right name="general.tab_bans" access="false"></right> <right name="general.tab_adminchat" access="false"></right> <right name="command.freeze" access="false"></right> <right name="command.setnick" access="false"></right> <right name="command.shout" access="false"></right> <right name="command.spectate" access="false"></right> <right name="command.slap" access="false"></right> <right name="command.setgroup" access="false"></right> <right name="command.sethealth" access="false"></right> <right name="command.setarmour" access="false"></right> <right name="command.setmoney" access="false"></right> <right name="command.setskin" access="false"></right> <right name="command.setteam" access="false"></right> <right name="command.giveweapon" access="false"></right> <right name="command.setstat" access="false"></right> <right name="command.jetpack" access="false"></right> <right name="command.warp" access="false"></right> <right name="command.setdimension" access="false"></right> <right name="command.setinterior" access="false"></right> <right name="command.createteam" access="false"></right> <right name="command.destroyteam" access="false"></right> <right name="command.givevehicle" access="false"></right> <right name="command.repair" access="false"></right> <right name="command.blowvehicle" access="false"></right> <right name="command.destroyvehicle" access="false"></right> <right name="command.customize" access="false"></right> <right name="command.setcolor" access="false"></right> <right name="command.setpaintjob" access="false"></right> <right name="command.listmessages" access="false"></right> <right name="command.readmessage" access="false"></right> <right name="command.listresources" access="false"></right> <right name="command.delete" access="false"></right> <right name="command.execute" access="false"></right> <right name="command.setpassword" access="false"></right> <right name="command.setwelcome" access="false"></right> <right name="command.setgame" access="false"></right> <right name="command.setmap" access="false"></right> <right name="command.setweather" access="false"></right> <right name="command.blendweather" access="false"></right> <right name="command.setblurlevel" access="false"></right> <right name="command.setwaveheight" access="false"></right> <right name="command.setskygradient" access="false"></right> <right name="command.setgamespeed" access="false"></right> <right name="command.setgravity" access="false"></right> <right name="command.settime" access="false"></right> <right name="command.setfpslimit" access="false"></right> <right name="command.clearchat" access="false"></right> <right name="command.unban" access="false"></right> <right name="command.banserial" access="false"></right> <right name="command.unbanserial" access="false"></right> <right name="command.listbans" access="false"></right> </acl> <acl name="Moderator"> <right name="general.ModifyOtherObjects" access="false"></right> <right name="command.gamemode" access="true"></right> <right name="command.changemode" access="true"></right> <right name="command.changemap" access="true"></right> <right name="command.stopmode" access="true"></right> <right name="command.stopmap" access="true"></right> <right name="command.skipmap" access="true"></right> <right name="command.mute" access="true"></right> <right name="command.unmute" access="true"></right> <right name="command.whois" access="true"></right> <right name="command.whowas" access="true"></right> <right name="function.setPlayerMuted" access="true"></right> <right name="function.kickPlayer" access="true"></right> <right name="function.banPlayer" access="true"></right> <right name="function.getBans" access="true"></right> <right name="function.addBan" access="true"></right> <right name="function.startResource" access="true"></right> <right name="function.stopResource" access="true"></right> <right name="function.restartResource" access="true"></right> <right name="function.refreshResources" access="true"></right> <right name="function.redirectPlayer" access="true"></right> <right name="general.adminpanel" access="true"></right> <right name="general.tab_players" access="true"></right> <right name="general.tab_resources" access="false"></right> <right name="general.tab_maps" access="false"></right> <right name="general.tab_server" access="true"></right> <right name="general.tab_bans" access="false"></right> <right name="general.tab_adminchat" access="true"></right> <right name="command.kick" access="false"></right> <right name="command.freeze" access="true"></right> <right name="command.setnick" access="true"></right> <right name="command.shout" access="true"></right> <right name="command.spectate" access="true"></right> <right name="command.slap" access="true"></right> <right name="command.setgroup" access="false"></right> <right name="command.sethealth" access="true"></right> <right name="command.setarmour" access="true"></right> <right name="command.setmoney" access="false"></right> <right name="command.setskin" access="true"></right> <right name="command.setteam" access="true"></right> <right name="command.giveweapon" access="true"></right> <right name="command.setstat" access="true"></right> <right name="command.jetpack" access="true"></right> <right name="command.warp" access="true"></right> <right name="command.setdimension" access="true"></right> <right name="command.setinterior" access="true"></right> <right name="command.createteam" access="false"></right> <right name="command.destroyteam" access="false"></right> <right name="command.givevehicle" access="true"></right> <right name="command.repair" access="true"></right> <right name="command.blowvehicle" access="true"></right> <right name="command.destroyvehicle" access="true"></right> <right name="command.customize" access="true"></right> <right name="command.setcolor" access="true"></right> <right name="command.setpaintjob" access="true"></right> <right name="command.listmessages" access="true"></right> <right name="command.readmessage" access="true"></right> <right name="command.listresources" access="true"></right> <right name="command.start" access="false"></right> <right name="command.stop" access="false"></right> <right name="command.stopall" access="false"></right> <right name="command.delete" access="false"></right> <right name="command.restart" access="false"></right> <right name="command.execute" access="false"></right> <right name="command.setpassword" access="false"></right> <right name="command.setwelcome" access="false"></right> <right name="command.setgame" access="false"></right> <right name="command.setmap" access="false"></right> <right name="command.setweather" access="true"></right> <right name="command.blendweather" access="true"></right> <right name="command.setblurlevel" access="true"></right> <right name="command.setwaveheight" access="true"></right> <right name="command.setskygradient" access="true"></right> <right name="command.setgamespeed" access="true"></right> <right name="command.setgravity" access="true"></right> <right name="command.settime" access="true"></right> <right name="command.setfpslimit" access="false"></right> <right name="command.clearchat" access="true"></right> <right name="command.ban" access="false"></right> <right name="command.unban" access="false"></right> <right name="command.banip" access="false"></right> <right name="command.unbanip" access="false"></right> <right name="command.banserial" access="false"></right> <right name="command.unbanserial" access="false"></right> <right name="command.listbans" access="false"></right> </acl> <acl name="SuperModerator"> <right name="general.ModifyOtherObjects" access="false"></right> <right name="command.start" access="true"></right> <right name="command.stop" access="true"></right> <right name="command.restart" access="true"></right> <right name="command.kick" access="true"></right> <right name="command.ban" access="true"></right> <right name="command.banip" access="true"></right> <right name="command.unbanip" access="true"></right> <right name="command.reloadbans" access="true"></right> <right name="command.refresh" access="true"></right> <right name="command.refreshall" access="true"></right> <right name="command.loadmodule" access="true"></right> <right name="command.unloadmodule" access="true"></right> <right name="command.reloadmodule" access="true"></right> <right name="command.addaccount" access="true"></right> <right name="function.addAccount" access="true"></right> <right name="function.setAccountName" access="true"></right> <right name="function.setAccountPassword" access="true"></right> <right name="general.adminpanel" access="true"></right> <right name="general.tab_players" access="true"></right> <right name="general.tab_resources" access="true"></right> <right name="general.tab_maps" access="true"></right> <right name="general.tab_server" access="true"></right> <right name="general.tab_bans" access="true"></right> <right name="general.tab_adminchat" access="true"></right> <right name="command.freeze" access="true"></right> <right name="command.mute" access="true"></right> <right name="command.setnick" access="true"></right> <right name="command.shout" access="true"></right> <right name="command.spectate" access="true"></right> <right name="command.slap" access="true"></right> <right name="command.setgroup" access="false"></right> <right name="command.sethealth" access="true"></right> <right name="command.setarmour" access="true"></right> <right name="command.setmoney" access="true"></right> <right name="command.setskin" access="true"></right> <right name="command.setteam" access="true"></right> <right name="command.giveweapon" access="true"></right> <right name="command.setstat" access="true"></right> <right name="command.jetpack" access="true"></right> <right name="command.warp" access="true"></right> <right name="command.setdimension" access="true"></right> <right name="command.setinterior" access="true"></right> <right name="command.createteam" access="true"></right> <right name="command.destroyteam" access="true"></right> <right name="command.givevehicle" access="true"></right> <right name="command.repair" access="true"></right> <right name="command.blowvehicle" access="true"></right> <right name="command.destroyvehicle" access="true"></right> <right name="command.customize" access="true"></right> <right name="command.setcolor" access="true"></right> <right name="command.setpaintjob" access="true"></right> <right name="command.listmessages" access="true"></right> <right name="command.readmessage" access="true"></right> <right name="command.listresources" access="true"></right> <right name="command.stopall" access="false"></right> <right name="command.delete" access="false"></right> <right name="command.execute" access="false"></right> <right name="command.setpassword" access="true"></right> <right name="command.setwelcome" access="true"></right> <right name="command.setgame" access="true"></right> <right name="command.setmap" access="true"></right> <right name="command.setweather" access="true"></right> <right name="command.blendweather" access="true"></right> <right name="command.setblurlevel" access="true"></right> <right name="command.setwaveheight" access="true"></right> <right name="command.setskygradient" access="true"></right> <right name="command.setgamespeed" access="true"></right> <right name="command.setgravity" access="true"></right> <right name="command.settime" access="true"></right> <right name="command.setfpslimit" access="false"></right> <right name="command.clearchat" access="true"></right> <right name="command.unban" access="true"></right> <right name="command.banserial" access="true"></right> <right name="command.unbanserial" access="true"></right> <right name="command.listbans" access="true"></right> </acl> <acl name="Admin"> <right name="general.ModifyOtherObjects" access="true"></right> <right name="general.http" access="true"></right> <right name="command.shutdown" access="true"></right> <right name="command.install" access="true"></right> <right name="command.aexec" access="true"></right> <right name="command.debugscript" access="true"></right> <right name="command.upgrade" access="true"></right> <right name="command.crun" access="true"></right> <right name="command.srun" access="true"></right> <right name="command.run" access="true"></right> <right name="command.aclrequest" access="true"></right> <right name="command.authserial" access="true"></right> <right name="command.reloadacl" access="true"></right> <right name="command.stopall" access="true"></right> <right name="command.delaccount" access="true"></right> <right name="command.chgpass" access="true"></right> <right name="function.addBan" access="true"></right> <right name="function.setUnbanTime" access="true"></right> <right name="function.setBanAdmin" access="true"></right> <right name="function.setBanReason" access="true"></right> <right name="function.setBanNick" access="true"></right> <right name="function.removeBan" access="true"></right> <right name="function.reloadBans" access="true"></right> <right name="function.executeCommandHandler" access="true"></right> <right name="function.setServerPassword" access="true"></right> <right name="function.getServerPassword" access="true"></right> <right name="function.createResource" access="true"></right> <right name="function.copyResource" access="true"></right> <right name="function.addResourceMap" access="true"></right> <right name="function.addResourceConfig" access="true"></right> <right name="function.removeResourceFile" access="true"></right> <right name="function.setResourceDefaultSetting" access="true"></right> <right name="function.removeResourceDefaultSetting" access="true"></right> <right name="function.aclReload" access="true"></right> <right name="function.aclSave" access="true"></right> <right name="function.aclCreate" access="true"></right> <right name="function.aclDestroy" access="true"></right> <right name="function.aclSetRight" access="true"></right> <right name="function.aclRemoveRight" access="true"></right> <right name="function.aclCreateGroup" access="true"></right> <right name="function.aclDestroyGroup" access="true"></right> <right name="function.aclGroupAddACL" access="true"></right> <right name="function.aclGroupRemoveACL" access="true"></right> <right name="function.aclGroupAddObject" access="true"></right> <right name="function.aclGroupRemoveObject" access="true"></right> <right name="function.refreshResources" access="true"></right> <right name="function.setServerConfigSetting" access="true"></right> <right name="function.updateResourceACLRequest" access="true"></right> <right name="function.shutdown" access="true"></right> <right name="function.setPlayerScriptDebugLevel" access="true"></right> <right name="function.removeAccount" access="true"></right> <right name="general.adminpanel" access="true"></right> <right name="general.tab_players" access="true"></right> <right name="general.tab_resources" access="true"></right> <right name="general.tab_maps" access="true"></right> <right name="general.tab_server" access="true"></right> <right name="general.tab_bans" access="true"></right> <right name="general.tab_adminchat" access="true"></right> <right name="command.kick" access="true"></right> <right name="command.freeze" access="true"></right> <right name="command.mute" access="true"></right> <right name="command.setnick" access="true"></right> <right name="command.shout" access="true"></right> <right name="command.spectate" access="true"></right> <right name="command.slap" access="true"></right> <right name="command.setgroup" access="true"></right> <right name="command.sethealth" access="true"></right> <right name="command.setarmour" access="true"></right> <right name="command.setmoney" access="true"></right> <right name="command.setskin" access="true"></right> <right name="command.setteam" access="true"></right> <right name="command.giveweapon" access="true"></right> <right name="command.setstat" access="true"></right> <right name="command.jetpack" access="true"></right> <right name="command.warp" access="true"></right> <right name="command.setdimension" access="true"></right> <right name="command.setinterior" access="true"></right> <right name="command.createteam" access="true"></right> <right name="command.destroyteam" access="true"></right> <right name="command.givevehicle" access="true"></right> <right name="command.repair" access="true"></right> <right name="command.blowvehicle" access="true"></right> <right name="command.destroyvehicle" access="true"></right> <right name="command.customize" access="true"></right> <right name="command.setcolor" access="true"></right> <right name="command.setpaintjob" access="true"></right> <right name="command.listmessages" access="true"></right> <right name="command.readmessage" access="true"></right> <right name="command.listresources" access="true"></right> <right name="command.start" access="true"></right> <right name="command.stop" access="true"></right> <right name="command.delete" access="true"></right> <right name="command.restart" access="true"></right> <right name="command.execute" access="true"></right> <right name="command.setpassword" access="true"></right> <right name="command.setwelcome" access="true"></right> <right name="command.setgame" access="true"></right> <right name="command.setmap" access="true"></right> <right name="command.setweather" access="true"></right> <right name="command.blendweather" access="true"></right> <right name="command.setblurlevel" access="true"></right> <right name="command.setwaveheight" access="true"></right> <right name="command.setskygradient" access="true"></right> <right name="command.setgamespeed" access="true"></right> <right name="command.setgravity" access="true"></right> <right name="command.settime" access="true"></right> <right name="command.setfpslimit" access="true"></right> <right name="command.clearchat" access="true"></right> <right name="command.ban" access="true"></right> <right name="command.unban" access="true"></right> <right name="command.banip" access="true"></right> <right name="command.unbanip" access="true"></right> <right name="command.banserial" access="true"></right> <right name="command.unbanserial" access="true"></right> <right name="command.listbans" access="true"></right> </acl> <acl name="RPC"> <right name="function.callRemote" access="true"></right> <right name="function.fetchRemote" access="true"></right> <right name="general.adminpanel" access="false"></right> <right name="general.tab_players" access="false"></right> <right name="general.tab_resources" access="false"></right> <right name="general.tab_maps" access="false"></right> <right name="general.tab_server" access="false"></right> <right name="general.tab_bans" access="false"></right> <right name="general.tab_adminchat" access="false"></right> <right name="command.kick" access="false"></right> <right name="command.freeze" access="false"></right> <right name="command.mute" access="false"></right> <right name="command.setnick" access="false"></right> <right name="command.shout" access="false"></right> <right name="command.spectate" access="false"></right> <right name="command.slap" access="false"></right> <right name="command.setgroup" access="false"></right> <right name="command.sethealth" access="false"></right> <right name="command.setarmour" access="false"></right> <right name="command.setmoney" access="false"></right> <right name="command.setskin" access="false"></right> <right name="command.setteam" access="false"></right> <right name="command.giveweapon" access="false"></right> <right name="command.setstat" access="false"></right> <right name="command.jetpack" access="false"></right> <right name="command.warp" access="false"></right> <right name="command.setdimension" access="false"></right> <right name="command.setinterior" access="false"></right> <right name="command.createteam" access="false"></right> <right name="command.destroyteam" access="false"></right> <right name="command.givevehicle" access="false"></right> <right name="command.repair" access="false"></right> <right name="command.blowvehicle" access="false"></right> <right name="command.destroyvehicle" access="false"></right> <right name="command.customize" access="false"></right> <right name="command.setcolor" access="false"></right> <right name="command.setpaintjob" access="false"></right> <right name="command.listmessages" access="false"></right> <right name="command.readmessage" access="false"></right> <right name="command.listresources" access="false"></right> <right name="command.start" access="false"></right> <right name="command.stop" access="false"></right> <right name="command.stopall" access="false"></right> <right name="command.delete" access="false"></right> <right name="command.restart" access="false"></right> <right name="command.execute" access="false"></right> <right name="command.setpassword" access="false"></right> <right name="command.setwelcome" access="false"></right> <right name="command.setgame" access="false"></right> <right name="command.setmap" access="false"></right> <right name="command.setweather" access="false"></right> <right name="command.blendweather" access="false"></right> <right name="command.setblurlevel" access="false"></right> <right name="command.setwaveheight" access="false"></right> <right name="command.setskygradient" access="false"></right> <right name="command.setgamespeed" access="false"></right> <right name="command.setgravity" access="false"></right> <right name="command.settime" access="false"></right> <right name="command.setfpslimit" access="false"></right> <right name="function.shutdown" access="false"></right> <right name="command.clearchat" access="false"></right> <right name="command.ban" access="false"></right> <right name="command.unban" access="false"></right> <right name="command.banip" access="false"></right> <right name="command.unbanip" access="false"></right> <right name="command.banserial" access="false"></right> <right name="command.unbanserial" access="false"></right> <right name="command.listbans" access="false"></right> </acl> <acl name="MapEditor"> <right name="general.ModifyOtherObjects" access="true"></right> <right name="function.startResource" access="true"></right> <right name="function.stopResource" access="true"></right> <right name="function.restartResource" access="true"></right> <right name="function.createResource" access="true"></right> <right name="function.copyResource" access="true"></right> <right name="function.renameResource" access="true"></right> <right name="function.deleteResource" access="true"></right> <right name="function.addResourceMap" access="true"></right> <right name="function.addResourceConfig" access="true"></right> <right name="function.removeResourceFile" access="true"></right> <right name="function.setResourceDefaultSetting" access="true"></right> <right name="function.removeResourceDefaultSetting" access="true"></right> <right name="function.xmlLoadFile" access="true"></right> <right name="function.refreshResources" access="true"></right> <right name="general.adminpanel" access="false"></right> <right name="general.tab_players" access="false"></right> <right name="general.tab_resources" access="false"></right> <right name="general.tab_maps" access="false"></right> <right name="general.tab_server" access="false"></right> <right name="general.tab_bans" access="false"></right> <right name="general.tab_adminchat" access="false"></right> <right name="command.kick" access="false"></right> <right name="command.freeze" access="false"></right> <right name="command.mute" access="false"></right> <right name="command.setnick" access="false"></right> <right name="command.shout" access="false"></right> <right name="command.spectate" access="false"></right> <right name="command.slap" access="false"></right> <right name="command.setgroup" access="false"></right> <right name="command.sethealth" access="false"></right> <right name="command.setarmour" access="false"></right> <right name="command.setmoney" access="false"></right> <right name="command.setskin" access="false"></right> <right name="command.setteam" access="false"></right> <right name="command.giveweapon" access="false"></right> <right name="command.setstat" access="false"></right> <right name="command.jetpack" access="false"></right> <right name="command.warp" access="false"></right> <right name="command.setdimension" access="false"></right> <right name="command.setinterior" access="false"></right> <right name="command.createteam" access="false"></right> <right name="command.destroyteam" access="false"></right> <right name="command.givevehicle" access="false"></right> <right name="command.repair" access="false"></right> <right name="command.blowvehicle" access="false"></right> <right name="command.destroyvehicle" access="false"></right> <right name="command.customize" access="false"></right> <right name="command.setcolor" access="false"></right> <right name="command.setpaintjob" access="false"></right> <right name="command.listmessages" access="false"></right> <right name="command.readmessage" access="false"></right> <right name="command.listresources" access="false"></right> <right name="command.start" access="false"></right> <right name="command.stop" access="false"></right> <right name="command.stopall" access="false"></right> <right name="command.delete" access="false"></right> <right name="command.restart" access="false"></right> <right name="command.execute" access="false"></right> <right name="command.setpassword" access="false"></right> <right name="command.setwelcome" access="false"></right> <right name="command.setgame" access="false"></right> <right name="command.setmap" access="false"></right> <right name="command.setweather" access="false"></right> <right name="command.blendweather" access="false"></right> <right name="command.setblurlevel" access="false"></right> <right name="command.setwaveheight" access="false"></right> <right name="command.setskygradient" access="false"></right> <right name="command.setgamespeed" access="false"></right> <right name="command.setgravity" access="false"></right> <right name="command.settime" access="false"></right> <right name="command.setfpslimit" access="false"></right> <right name="function.shutdown" access="false"></right> <right name="command.clearchat" access="false"></right> <right name="command.ban" access="false"></right> <right name="command.unban" access="false"></right> <right name="command.banip" access="false"></right> <right name="command.unbanip" access="false"></right> <right name="command.banserial" access="false"></right> <right name="command.unbanserial" access="false"></right> <right name="command.listbans" access="false"></right> </acl> <acl name="raceACL"> <right name="general.ModifyOtherObjects" access="true"></right> <right name="function.xmlLoadFile" access="true"></right> <right name="function.startResource" access="true"></right> <right name="function.stopResource" access="true"></right> <right name="function.restartResource" access="true"></right> <right name="general.adminpanel" access="false"></right> <right name="general.tab_players" access="false"></right> <right name="general.tab_resources" access="false"></right> <right name="general.tab_maps" access="false"></right> <right name="general.tab_server" access="false"></right> <right name="general.tab_bans" access="false"></right> <right name="general.tab_adminchat" access="false"></right> <right name="command.kick" access="false"></right> <right name="command.freeze" access="false"></right> <right name="command.mute" access="false"></right> <right name="command.setnick" access="false"></right> <right name="command.shout" access="false"></right> <right name="command.spectate" access="false"></right> <right name="command.slap" access="false"></right> <right name="command.setgroup" access="false"></right> <right name="command.sethealth" access="false"></right> <right name="command.setarmour" access="false"></right> <right name="command.setmoney" access="false"></right> <right name="command.setskin" access="false"></right> <right name="command.setteam" access="false"></right> <right name="command.giveweapon" access="false"></right> <right name="command.setstat" access="false"></right> <right name="command.jetpack" access="false"></right> <right name="command.warp" access="false"></right> <right name="command.setdimension" access="false"></right> <right name="command.setinterior" access="false"></right> <right name="command.createteam" access="false"></right> <right name="command.destroyteam" access="false"></right> <right name="command.givevehicle" access="false"></right> <right name="command.repair" access="false"></right> <right name="command.blowvehicle" access="false"></right> <right name="command.destroyvehicle" access="false"></right> <right name="command.customize" access="false"></right> <right name="command.setcolor" access="false"></right> <right name="command.setpaintjob" access="false"></right> <right name="command.listmessages" access="false"></right> <right name="command.readmessage" access="false"></right> <right name="command.listresources" access="false"></right> <right name="command.start" access="false"></right> <right name="command.stop" access="false"></right> <right name="command.stopall" access="false"></right> <right name="command.delete" access="false"></right> <right name="command.restart" access="false"></right> <right name="command.execute" access="false"></right> <right name="command.setpassword" access="false"></right> <right name="command.setwelcome" access="false"></right> <right name="command.setgame" access="false"></right> <right name="command.setmap" access="false"></right> <right name="command.setweather" access="false"></right> <right name="command.blendweather" access="false"></right> <right name="command.setblurlevel" access="false"></right> <right name="command.setwaveheight" access="false"></right> <right name="command.setskygradient" access="false"></right> <right name="command.setgamespeed" access="false"></right> <right name="command.setgravity" access="false"></right> <right name="command.settime" access="false"></right> <right name="command.setfpslimit" access="false"></right> <right name="function.shutdown" access="false"></right> <right name="command.clearchat" access="false"></right> <right name="command.ban" access="false"></right> <right name="command.unban" access="false"></right> <right name="command.banip" access="false"></right> <right name="command.unbanip" access="false"></right> <right name="command.banserial" access="false"></right> <right name="command.unbanserial" access="false"></right> <right name="command.listbans" access="false"></right> </acl> <acl name="DevACL"> <right name="resource.performancebrowser.http" access="true"></right> <right name="resource.ajax.http" access="true"></right> <right name="general.adminpanel" access="false"></right> <right name="general.tab_players" access="false"></right> <right name="general.tab_resources" access="false"></right> <right name="general.tab_maps" access="false"></right> <right name="general.tab_server" access="false"></right> <right name="general.tab_bans" access="false"></right> <right name="general.tab_adminchat" access="false"></right> <right name="command.kick" access="false"></right> <right name="command.freeze" access="false"></right> <right name="command.mute" access="false"></right> <right name="command.setnick" access="false"></right> <right name="command.shout" access="false"></right> <right name="command.spectate" access="false"></right> <right name="command.slap" access="false"></right> <right name="command.setgroup" access="false"></right> <right name="command.sethealth" access="false"></right> <right name="command.setarmour" access="false"></right> <right name="command.setmoney" access="false"></right> <right name="command.setskin" access="false"></right> <right name="command.setteam" access="false"></right> <right name="command.giveweapon" access="false"></right> <right name="command.setstat" access="false"></right> <right name="command.jetpack" access="false"></right> <right name="command.warp" access="false"></right> <right name="command.setdimension" access="false"></right> <right name="command.setinterior" access="false"></right> <right name="command.createteam" access="false"></right> <right name="command.destroyteam" access="false"></right> <right name="command.givevehicle" access="false"></right> <right name="command.repair" access="false"></right> <right name="command.blowvehicle" access="false"></right> <right name="command.destroyvehicle" access="false"></right> <right name="command.customize" access="false"></right> <right name="command.setcolor" access="false"></right> <right name="command.setpaintjob" access="false"></right> <right name="command.listmessages" access="false"></right> <right name="command.readmessage" access="false"></right> <right name="command.listresources" access="false"></right> <right name="command.start" access="false"></right> <right name="command.stop" access="false"></right> <right name="command.stopall" access="false"></right> <right name="command.delete" access="false"></right> <right name="command.restart" access="false"></right> <right name="command.execute" access="false"></right> <right name="command.setpassword" access="false"></right> <right name="command.setwelcome" access="false"></right> <right name="command.setgame" access="false"></right> <right name="command.setmap" access="false"></right> <right name="command.setweather" access="false"></right> <right name="command.blendweather" access="false"></right> <right name="command.setblurlevel" access="false"></right> <right name="command.setwaveheight" access="false"></right> <right name="command.setskygradient" access="false"></right> <right name="command.setgamespeed" access="false"></right> <right name="command.setgravity" access="false"></right> <right name="command.settime" access="false"></right> <right name="command.setfpslimit" access="false"></right> <right name="function.shutdown" access="false"></right> <right name="command.clearchat" access="false"></right> <right name="command.ban" access="false"></right> <right name="command.unban" access="false"></right> <right name="command.banip" access="false"></right> <right name="command.unbanip" access="false"></right> <right name="command.banserial" access="false"></right> <right name="command.unbanserial" access="false"></right> <right name="command.listbans" access="false"></right> </acl> <acl name="autoACL_guieditor"> <right name="general.ModifyOtherObjects" access="true" who="" pending="true" date=""></right> <right name="function.callRemote" access="true" who="" pending="true" date=""></right> </acl> <acl name="autoACL_gui_editor"> <right name="general.ModifyOtherObjects" access="true" who="" pending="true" date=""></right> <right name="function.callRemote" access="true" who="" pending="true" date=""></right> </acl> </acl> https://imgur.com/kj56V9Q Pic of my FTP files incase there's something missing that's bugging the acl? idkkk https://imgur.com/kj56V9Q Pic of my FTP files incase there's something missing that's bugging the acl? idkkk
  9. Hi i just wanna know if i did it correctly, i created teams from a table, like this, it works fine, it creates the teams in the table, but i just wanna know if there's a better way / optimized of doing it or is this fine? local teams = { { "Team1", 0, 180, 0 }, { "Team2", 180, 50, 50 } } for k,v in ipairs( teams ) do teams = createTeam ( v[1], v[2], v[3], v[4]) end
  10. btw i tried the opposite version of them sharing timers, no individual timers anymore, that's easy, but im having a problem, how do you define a player in serverside? no matter how i put thePlayer, or try to define it it always says nil such as this, i want to happen that this function only happens if the player is in the areaex colshape function stage2 (thePlayer, matchingDimension) local detection = isElementWithinColShape ( thePlayer, areaex ) detection = detection and getElementDimension( thePlayer ) == getElementDimension( areaex ) if detection then local pX, pY, pZ = getElementPosition ( thePlayer ) local locations = { { pX+20, pY, pZ }, { pX+30, pY, pZ}, { pX+30, pY+20, pZ}, { pX, pY+35, pZ}, { pX, pY+40, pZ}, { pX+60, pY, pZ } } loc = math.random(#locations) createExplosion ( locations[loc][1], locations[loc][2], locations[loc][3], 6, source ) timers = setTimer(stage3, 1500, 1, source) end end isElementWithinColShape, expected element at argument 1, got nil. how do you define a player in serverside?
  11. function stage1 (hitPlayer) outputChatBox("bomb", hitPlayer, 255, 0, 0) local pX, pY, pZ = getElementPosition ( hitPlayer ) local locations = { { pX+20, pY, pZ }, { pX+30, pY, pZ}, { pX+30, pY+20, pZ}, { pX, pY+35, pZ}, { pX, pY+40, pZ}, { pX+60, pY, pZ } } loc = math.random(#locations) createExplosion ( locations[loc][1], locations[loc][2], locations[loc][3], 6, hitPlayer ) timers[hitPlayer] = setTimer(stage2, 5*1000, 1, hitPlayer) end function stage2 (hitPlayer) outputChatBox("repeat", hitPlayer, 0, 255, 0) timers[hitPlayer] = nil timers[hitPlayer] = setTimer(stage1, 3000, 1, hitPlayer) end ohhh i got it, so basically like this right? anyways thanks man, u helped me so much today.
  12. function leaveZone(hitPlayer) if timers[ hitPlayer ] then if isTimer(timers[ hitPlayer ] ) then killTimer(timers[ hitPlayer ] ) outputChatBox("leaving",hitPlayer) end end end timers[ hitPlayer ] = nil addEventHandler( "onColShapeLeave", areaex, leaveZone ) table index is nil line 51, 51 is timers [hitPlayer] = nil whats the problem? EDIT: nvm i just put the line 51 above the ends, idk if thats fine but it fixed the error. anyways i want a time loop, but as u said its safer to just make the timer to "1", not "0", how is it possible to make an endless loop without the "0"?, like example i want the same cycle to repeat every 5 minutes. i tried making a loop by making the start stage a "0" but ended up getting messy. its sad
  13. may I ask why u put the timer [ hitPlayer ] = nil after the end? what is the explanation.
  14. function leaveZone(hitPlayer) if isElement(hitPlayer) and getElementType(hitPlayer) == "player" then if timers[ hitPlayer ] then if isTimer(timers[ hitPlayer ] ) then killTimer(timers[ hitPlayer ] ) outputChatBox("leaving",hitPlayer) end end end end addEventHandler( "onColShapeLeave", areaex, leaveZone ) Player leaves Colshape, all timers in the timertable will be killed. is this correct? (only his timers, not others)
  15. function stage3 (hitPlayer) timers[hitPlayer] = nil end Thanks for these, i got an idea now, and btw the stage3 is where it stops the timer right? and as i'm aware it'll only stop for the player right? not all of them.
  16. update: here first loop is fine, works fine, but when the second loop comes, timer1 starts, timer2 starts, then is ended instantly by timer 3. no delays how is that?, nvm i get it now, because i had put the timer3 on loop as well, on the timer2, so it gives multiple timer3s, how can i fix this? or how can i put the timer3 out of timer2 then if timer2 starts, it starts too.
  17. and last, how do i create a timer within a timer? I tried but its hard i created another table for the timer 2, and it kinda works, but idk if thats well optimized, the problem is i want to kill the timer2 after 5 seconds its been going on, how do I do that? timers[ hitPlayer ] = setTimer ( function() timer2[ hitPlayer ] = setTimer(function() loc = math.random(#locations) createExplosion ( locations[loc][1], locations[loc][2], locations[loc][3], 6, hitPlayer ) end, 1500, 0) end, 10000, 0 ) end end addEventHandler( "onColShapeHit", areaex, enterZone ) EDIT: i did this, is this fine? it works kinda fine but i want u to take a look if its really okay, edit again: nvm this is buggy, im having a hard time killing timer2, i executed it , but timer 3 is looping as well. local timers = { }; local timer2 = { }; local timer3= { }; function enterZone(hitPlayer) if isElement(hitPlayer) and getElementType(hitPlayer) == "player" then outputChatBox("enter",hitPlayer, 255, 0, 0) timers[ hitPlayer ] = setTimer ( function() outputChatBox("started", hitPlayer, 255, 0, 0) timer2[ hitPlayer ] = setTimer ( function() local pX, pY, pZ = getElementPosition ( hitPlayer ) local locations = { { pX+20, pY, pZ }, { pX+30, pY, pZ}, { pX+30, pY+20, pZ}, { pX, pY+35, pZ}, { pX, pY+40, pZ}, { pX+60, pY, pZ } } loc = math.random(#locations) createExplosion ( locations[loc][1], locations[loc][2], locations[loc][3], 6, hitPlayer ) timer3[hitPlayer] = setTimer(function() if isTimer(timer2[hitPlayer]) then killTimer(timer2[hitPlayer]) outputChatBox("ended", hitElement, 0, 255, 0) end end, 5000, 1) end, 2000, 0 ) end, 12000, 0 ) end end addEventHandler( "onColShapeHit", areaex, enterZone )
  18. it works but i haven't tested it with players yet, im just not sure if it would kill other player's timers anyway can u help me with this code, i put locations in the table that there would be a random nearby explosion around the player so i made these the problem is I dont know how to make it work as i want to since i made a loop that a certain explosion would happen but it only happens on 1 place, and i'm aware of that, the real problem is idk how to make all locations in the table be in the createExplosion randomly, it just picks one location in the table and it repeats, how to solve that? function enterZone(hitPlayer) if isElement(hitPlayer) and getElementType(hitPlayer) == "player" then local pX, pY, pZ = getElementPosition ( hitPlayer ) local locations = { { pX, pY, pZ }, { pX+30, pY+60, pZ}, { pX+60, pY, pZ } } loc = math.random(#locations) timers[ hitPlayer ] = setTimer ( function() createExplosion ( locations[loc][1], locations[loc][2], locations[loc][3], 6, hitPlayer ) end, 5000, 0 ) end end addEventHandler( "onColShapeHit", areaex, enterZone )
  19. Hello, i just want to know if my code is correct, this is serverside, I created a timer table so if a player leaves the zone the others timer and explosions wont stop, only his, is my code correct or im doing things really wrong? local areaex = createColRectangle ( 2076.61499, 971.57928, 50, 50) local arearadar = createRadarArea ( 2076.61499, 971.57928, 50, 50, 0, 255, 0, 100) local timers = { }; function enterZone(hitPlayer) if isElement(hitPlayer) and getElementType(hitPlayer) == "player" then outputChatBox("Entering zone",hitPlayer, 255, 0, 0) local pX, pY, pZ = getElementPosition ( hitPlayer ) timers[ hitPlayer ] = setTimer ( function() createExplosion ( pX+math.random(-30,30), pY, pZ, 6, source ) end, 3000, 0 ) end end addEventHandler( "onColShapeHit", areaex, enterZone ) function leaveZone(hitPlayer) if isElement(hitPlayer) and getElementType(hitPlayer) == "player" then outputChatBox("leaving",hitPlayer) killTimer( timers[ hitPlayer ] ); end end addEventHandler( "onColShapeLeave", areaex, leaveZone )
  20. yeah this is cool function closedx() removeEventHandler("onClientPreRender", getRootElement(), drawpistol); removeEventHandler("onClientPreRender", getRootElement(), drawsmg); end addEventHandler("onClientGUIClick", root,function() if ( source == close) then closedx() end end ) i took your advise, it worked perfectly but this code i tried above works too, dont mind it, but if i used that closedx(), its fine too right? will other players experience the closed function too or just him?
  21. Hi, its me again lol i want to make a non-messy code, how do I make all DX disappear in just one line, like i dont have to put 2 removeEventHandlers or more just to remove each one of them on one click. i only want 1 removeEventHandler for all of them to disappear instead of adding 1 by one, how to do that? the reason I didnt put the test text in the function drawpistol because they are different categories / tabs, thats why i put them on separate functions. function welcome() dxDrawText("test", (930/1920)*sx, (424/1080)*sy, (1254/1920)*sx, (452/1080)*sy, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) end function drawpistol() dxDrawImage((879/1920)*sx, (328/1080)*sy, (162/1920)*sx, (142/1080)*sy, ":guieditor/images/colt45icon.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage((997/1920)*sx, (556/1080)*sy, (157/1920)*sx, (144/1080)*sy, ":guieditor/images/desert_eagleicon.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage((1120/1920)*sx, (330/1080)*sy, (160/1920)*sx, (140/1080)*sy, ":guieditor/images/silencedicon.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEventHandler("onClientGUIClick", root,function() if ( source == close) then removeEventHandler("onClientPreRender", getRootElement(), drawmypistol); removeEventHandler("onClientPreRender", getRootElement(), welcome); removeEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(close, false) showCursor(false) end end )
  22. Hi, its me again lol i want to make a non-messy code, how do I make all DX disappear in just one line, like i dont have to put 2 removeEventHandlers or more just to remove each one of them on one click. i only want 1 removeEventHandler for all of them to disappear instead of adding 1 by one, how to do that? function welcome() dxDrawText("Welcome to the Weapon Shop, please choose a category", (930/1920)*sx, (424/1080)*sy, (1254/1920)*sx, (452/1080)*sy, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) end function drawpistol() dxDrawImage((879/1920)*sx, (328/1080)*sy, (162/1920)*sx, (142/1080)*sy, ":guieditor/images/colt45icon.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage((997/1920)*sx, (556/1080)*sy, (157/1920)*sx, (144/1080)*sy, ":guieditor/images/desert_eagleicon.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage((1120/1920)*sx, (330/1080)*sy, (160/1920)*sx, (140/1080)*sy, ":guieditor/images/silencedicon.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEventHandler("onClientGUIClick", root,function() if ( source == close) then removeEventHandler("onClientPreRender", getRootElement(), drawmypistol); removeEventHandler("onClientPreRender", getRootElement(), welcome); removeEventHandler("onClientPreRender", getRootElement(), draw); guiSetVisible(close, false) showCursor(false) end end )
  23. Bean666

    Question

    I made a simple hat script that attaches to a player, but there's a question for me since i made this serverside and i have the onPlayerWasted on root if he dies, will it remove other people's hat too since the player wasted is on root? or will it remove only his hat? if it does, how do i make it when a player dies only his hat gets removed? do i need to switch to client side? or am I missing something addCommandHandler("hat", function(p) object = createObject(2053, 0, 0, 0) local id = getElementModel ( p ) outputChatBox("test") if id == 0 then exports.bone_attach:attachElementToBone(object, p, 2, 0.01, -0.02, -0.48, 0, 0,110) end if id == 287 then exports.bone_attach:attachElementToBone(object, p, 2, 0, -0.01, -0.45, 0, 0,100) end if id == 285 then exports.bone_attach:attachElementToBone(object, p, 2, 0.005, -0.01, -0.45, 0, 0,100) end end ); addEventHandler( "onPlayerWasted", root, function() destroyElement(object) end )
×
×
  • Create New...