Jump to content

Adde

Members
  • Posts

    228
  • Joined

  • Last visited

Everything posted by Adde

  1. Hello, how should I do if I want to save the text from scoreboardColumn "Class" onPlayerQuit and then set that text back in same scoreboardColumn onPlayerLogin? Is this near right? function openClass() thePlayer = getPlayerAccount(source) if (thePlayer) then getAccountData(thePlayer, "theClass") setElementData(thePlayer, "theClass", Class) end end addEventHandler("onPlayerLogin",getRootElement(), openClass) function saveClass() thePlayer = getPlayerAccount(source) if (thePlayer) then local theClass = getElementData(source, "Class") setAccountData(thePlayer,"theClass", theClass) end end addEventHandler("onPlayerQuit",getRootElement(), saveClass) Thankfull for answears
  2. Adde

    TeamPanel

    Okay thx, I will change that and wait for players to tell me if it works as it should Btw, When someone die the cursor wont show. But it should. Nothing in debug. client function spawn() if not guiGetVisible(GUIEditor.window[2]) then guiSetVisible(GUIEditor.window[2], true) showCursor(true) end end end addEventHandler("onClientPlayerWasted",getLocalPlayer(), spawn) or wait, is player/source forgot on showCursor?
  3. Adde

    TeamPanel

    Hey guys, I have a problem. This is the function that I have to join Staff team in my team gui. But the problem is that everytime someone that don´t have premission to join staff press "Staff" button, the gui shows for everybody on the server. And when that button is pressed debug says (server triggered client side, event "onTeamAdmin", but event is not added client side). I just don´t get it how I should change so it works as it should (so gui not get visible for everyone when nonStaff press staff button). btw: it didn´t work with isObjectInACLGroup and then havePlayerPremissionTo... server function joinAdmin() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("HeadAdmin")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("SuperModerator")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Moderator")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("TrialStaff")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("TrialScripter")) then setPlayerTeam(source,teamAdmin) spawnPlayer ( source, 2216.51,-3195.87,6.5, 90 ) setElementModel(source,217) setPlayerNametagColor ( source, 255, 128, 0 ) setElementHealth(source,100) giveWeapon(source,24,600) giveWeapon(source,27,400) giveWeapon(source,30,700) giveWeapon(source,31,1500) giveWeapon(source,34,200) giveWeapon(source,38,2000) giveWeapon(source,16,40) setCameraTarget(source,player) else outputChatBox ( "[sALA]:You are not part of Staff!", source, 255,0,0 ) triggerClientEvent("onTeamAdmin", getRootElement(),source) end end addEvent("setTeamAdmin", true) addEventHandler("setTeamAdmin",getRootElement(),joinAdmin) client function flupp () guiSetVisible(GUIEditor.window[2],true) showCursor(true) end addEvent("onTeamAdmin", true) addEventHandler("onTeamAdmin", getLocalPlayer(), flupp)
  4. It could be because I had bugs and had to restart mta. So I reinstalled MTA and fixed a lot of bugs now and server haven´t closed in a while. Let´s wait and see.
  5. I got one that saves onQuit and one onPlayerWasted. The one that I edited and added didn´t give double ammo, but it only save 1 weapon even if I had slot 0 slot 1 slot 2 and more. I added the one he gave me and removed my own. Then I only had the one that saves everything (even money, skin, etc) onQuit, and the one he gave me. or should I sepparate weapons from the rest savesystem and do something like this: (team, money, etc here) and weapon save down here, something like this function give() (gives weapons using accountData) addEventHandler ( "onPlayerSpawn", root, give) addEventHandler ( "onPlayerLogin", root, give) function save() (saves weapons using accountData) addEventHandler ( "onPlayerWasted", root, save) addEventHandler ( "onPlayerQuit", root, save)
  6. It saves all weapons but now it gives double ammo on respawn
  7. Hello, I created/edited a savesystem "onWasted" for weapons so it doesn´t give double ammo on spawn (I took same accountdata saving from savesystem on community, and I have the rest of that part). But the problem I have now is that it only save the weapon that the player hold in his hands, and... if he doesn´t hold any weapon then it doesn´t save any of them. I hope that any of you can help me or help me save weapons onWasted with same accountdata. Thankfull for answears. Here is it: function playerspawn (thePreviousAccount, theCurrentAccount) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "funmodev2-money") if (accountData) then local playerWeaponID0 = getAccountData (theCurrentAccount, "funmodev2-weaponID0") local playerWeaponID1 = getAccountData (theCurrentAccount, "funmodev2-weaponID1") local playerWeaponID2 = getAccountData (theCurrentAccount, "funmodev2-weaponID2") local playerWeaponID3 = getAccountData (theCurrentAccount, "funmodev2-weaponID3") local playerWeaponID4 = getAccountData (theCurrentAccount, "funmodev2-weaponID4") local playerWeaponID5 = getAccountData (theCurrentAccount, "funmodev2-weaponID5") local playerWeaponID6 = getAccountData (theCurrentAccount, "funmodev2-weaponID6") local playerWeaponID7 = getAccountData (theCurrentAccount, "funmodev2-weaponID7") local playerWeaponID8 = getAccountData (theCurrentAccount, "funmodev2-weaponID8") local playerWeaponID9 = getAccountData (theCurrentAccount, "funmodev2-weaponID9") local playerWeaponID10 = getAccountData (theCurrentAccount, "funmodev2-weaponID10") local playerWeaponID11 = getAccountData (theCurrentAccount, "funmodev2-weaponID11") local playerWeaponID12 = getAccountData (theCurrentAccount, "funmodev2-weaponID12") local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo0") local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo1") local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo2") local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo3") local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo4") local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo5") local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo6") local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo7") local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo8") local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo9") local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo10") local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo11") local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo12") end end end addEventHandler ("onPlayerWasted", getRootElement(), playerspawn) function onWasted () if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then setAccountData (account, "funmodev2-weaponID0", getPedWeapon (source, 0)) setAccountData (account, "funmodev2-weaponID1", getPedWeapon (source, 1)) setAccountData (account, "funmodev2-weaponID2", getPedWeapon (source, 2)) setAccountData (account, "funmodev2-weaponID3", getPedWeapon (source, 3)) setAccountData (account, "funmodev2-weaponID4", getPedWeapon (source, 4)) setAccountData (account, "funmodev2-weaponID5", getPedWeapon (source, 5)) setAccountData (account, "funmodev2-weaponID6", getPedWeapon (source, 6)) setAccountData (account, "funmodev2-weaponID7", getPedWeapon (source, 7)) setAccountData (account, "funmodev2-weaponID8", getPedWeapon (source, -- s8) -->) setAccountData (account, "funmodev2-weaponID9", getPedWeapon (source, 9)) setAccountData (account, "funmodev2-weaponID10", getPedWeapon (source, 10)) setAccountData (account, "funmodev2-weaponID11", getPedWeapon (source, 11)) setAccountData (account, "funmodev2-weaponID12", getPedWeapon (source, 12)) setAccountData (account, "funmodev2-weaponAmmo0", getPedTotalAmmo (source, 0)) setAccountData (account, "funmodev2-weaponAmmo1", getPedTotalAmmo (source, 1)) setAccountData (account, "funmodev2-weaponAmmo2", getPedTotalAmmo (source, 2)) setAccountData (account, "funmodev2-weaponAmmo3", getPedTotalAmmo (source, 3)) setAccountData (account, "funmodev2-weaponAmmo4", getPedTotalAmmo (source, 4)) setAccountData (account, "funmodev2-weaponAmmo5", getPedTotalAmmo (source, 5)) setAccountData (account, "funmodev2-weaponAmmo6", getPedTotalAmmo (source, 6)) setAccountData (account, "funmodev2-weaponAmmo7", getPedTotalAmmo (source, 7)) setAccountData (account, "funmodev2-weaponAmmo8", getPedTotalAmmo (source, -- s8) -->) setAccountData (account, "funmodev2-weaponAmmo9", getPedTotalAmmo (source, 9)) setAccountData (account, "funmodev2-weaponAmmo10", getPedTotalAmmo (source, 10)) setAccountData (account, "funmodev2-weaponAmmo11", getPedTotalAmmo (source, 11)) setAccountData (account, "funmodev2-weaponAmmo12", getPedTotalAmmo (source, 12)) end end end addEventHandler ("onPlayerWasted", getRootElement(), onWasted)
  8. Hello, I wounder if anyone knows why my server crashes/shutdown. It can be everything from 1day to 1week between the server crashes, just like that. I know 1 thing, it isn´t the amount of players online that execute the server to crash. I checked the logs and it only say "Player left the game (timed out)" before it was shutdown. Anyone have same problem or had same problem? Is it something with the resources? Thankfull for answears.
  9. The data is right, I figured out the problem. You can´t use " - " when you set size, then the script wont accept it.
  10. It was 7 from the beginning, I just changed from 7 to 8 to 9 to 10 to test if it was that.
  11. Hello, I got a little problem with one script. When I add new Areas, It wont keep them zombieproof. It´s like the last 2 or 3 of them that´s not zombieproof and it doesn´t tell me anything in debug. local safeZoneRadar = { { -1704.0307, 644.0531, 150, 87, 0, 200, 0 }, { -1581.42, 419.68, 370, 100, 0, 200, 0 }, { 21.67, -2027.21, 3000, 1350, 0, 200, 0 }, { 827.55, -2828.13, 2194, 900, 0, 200, 0 }, { -72.80, 1641.66, 455, 461, 0, 200, 0 } , { -1631.71, 259.03, 320, 170, 0, 200, 0 } , { 2159.0454101563, -3506.8337402344, 330, 500, 200, 100, 0 }, { 141.91612243652, -152.04411315918, 140, -160, 0, 0, 100 }, { 74.169883728027, -143.12757873535, 70, -70, 0, 0, 100 }, { -2702.9335, 42.9113, -101, 117, 255, 20, 20 }, } addEventHandler( "onResourceStart", resourceRoot, function () for k, v in ipairs ( safeZoneRadar ) do local area = createRadarArea ( v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10] ) setElementData(area,"zombieProof", true) end end )
  12. It works perfect now, thx guys. I had to use setElementInterior and setElementDimension because I used it in an other interior to.
  13. I didn't say that you must set the alpha to 0, what I said is that you had it on 0, but had to be 255 or another value. Aha sorry, I misunderstood.
  14. works now. But marker 1 warps to itself.
  15. Yes I have the latest, I will test Hmm, the markers wont show
  16. Hello, in castillo´s script gang_system is the scoreboard column "Group" and then the name of the gang you are in. But how to continue this script so only players in example gang Glory can do this function below? please help. And btw, how do I set interior and dimension when I use createmarker? Or atleast dimension. marker1 = createMarker (-2639.30, 1406.47, 906.46,"cylinder",1.5,0,200,0,0) marker2 = createMarker (-2636.77, 1402.80, 906.46,"cylinder",1.5,0,200,0,0) function gangEntrence () account = getPlayerAccount(source) if is getElementData( "Glory") then setElementPosition(-2636.77, 1402.80, 906.46) end addEventHandler("onMarkerHit", marker1, gangEntrence) function gangExit () setElementPosition(-2639.30, 1406.47, 906.46) end addEventHandler("onMarkerHit", marker2, gangExit)
  17. No sry, I just helped you a bit on the way. You need something like this, but I don´t really know how to make it in this script. if (not isEnabled) then isEnabled = true addEventHandler ("onClientPreRender", root, updateCamera) addEventHandler ("onClientCursorMove",root, freecamMouse) radar = false else --reset view isEnabled = false setCameraTarget (localPlayer, localPlayer) removeEventHandler ("onClientPreRender", root, updateCamera) removeEventHandler ("onClientCursorMove", root, freecamMouse) radar = true
  18. Hmm, I don´t know that You should ask someone else about that or wait for someone to answear here.
  19. Aaah, thx guys. Now it works perfectly!
  20. Aha okay, so I shoould use that instead of the one I used from the beginning? and then add an event/create an event to the function? If I understand wiki right.
  21. So if I have this function registerHandler(username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox( "", root, 255, 255, 255 ) else account = addAccount(username, password) if (logIn(source, account, password) == true) then triggerClientEvent(source, "hideRegisterWindow", getRootElement()) end end end addEventHandler("submitRegister", root, registerHandler) I can do something like this Server side function registerHandler(username, password) local account = getAccount(username, password) if (account ~= false) then outputChatBox( "", root, 255, 255, 255 ) else account = addAccount(username, password) if (logIn(source, account, password) == true) then triggerClientEvent(source, "hideRegisterWindow", getRootElement()) triggerServerEvent(source, "playerSpawn", getRootElement()) end end end addEventHandler("submitRegister", root, registerHandler) function playerSpawn() setElementPosition(source, 232.23, 1904.39, 17.84) setPlayerTeam(source, "Army") setElementModel(source, 179) setPlayerNametagColor(source, 59, 166, 109) end
×
×
  • Create New...