Jump to content

Sande

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by Sande

  1. No idea, how fix it. My mind is empty..
  2. No errors, bank withdraw just not working. And ticket buying not give to money ACC name vlack. Becauce i dont have anything in my mind.
  3. I try much times get these codes work, but .... not working.
  4. Im so tired and angry when i try make these little codes works so can someone finish it. function ostaLippu ( thePlayer, myyja ) if getPlayerMoney(thePlayer) < 4000 then outputChatBox("Sinulla ei ole tarpeeksi rahaa ostaaksesi sisaanpaasya vlackin clubille.", thePlayer, 255, 0, 0) return end outputChatBox("[CLUB] Ostit lipukkeen vlackin clubiin!", thePlayer, 0,255,0) takePlayerMoney(thePlayer, 4000) --[[ Need to add if someone buy ticket, money goes to accountname vlack --]] end addCommandHandler("lippu", ostaLippu ) function setMoney(thePlayer,key,amount) --[[ Bank deposit --]] takePlayerMoney (thePlayer,amount) local account = getPlayerAccount(thePlayer) if account and tonumber(amount) then setAccountData(account,"nordea-cash",amount) outputChatBox("[NORDEA] Pistit tilillesi rahaa", thePlayer, 0,255,0) end end addCommandHandler("pano",setMoney) function nosta(thePlayer,key,amount) --[[ Bank withdraw --]] local playerMoney = getAccountData(playerAccount, "nordea-cash") if (playerMoney) then givePlayerMoney(thePlayer, amount ) outputChatBox("[NORDEA] Nostit tililtäsi rahaa", thePlayer, 0,255,0) end end addCommandHandler("nosto", nosta )
  5. Hey, i try make a mta safe. You can change the right 4 number code in script, and create marker to somewhere and when walk to the marker the SAFE first gui opens, and when you got right code and enter it other gui opening. I am now just maked gui becauce i wanna know how can make "GUI functions" like when you withdraw you get your moneys etc. And savesystem for moneys. I am not good scripter i am happy if someone make little serverside functions. Or tell me how to do that. Thank you so much if you help!! Client: -- Client side file -- The safe login GUIEditor = { button = {}, window = {}, label = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0.34, 0.41, 0.15, 0.19, "Kassakaappi", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.edit[1] = guiCreateEdit(95, 75, 102, 36, "", false, GUIEditor.window[1]) --[[ IMPORTANT THING NEED TO WRITE RIGHT CODE EXAMPLE 1234 and the you are in and deposit gui etc opens.--]] GUIEditor.label[1] = guiCreateLabel(122, 38, 75, 27, "Koodi:", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") GUIEditor.button[1] = guiCreateButton(95, 125, 102, 49, "OK", false, GUIEditor.window[1]) end ) -- Main page / Withdraw / Deposit page GUIEditor = { tab = {}, tabpanel = {}, edit = {}, button = {}, window = {}, label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(820, 515, 350, 274, "Kassakaappi: Kirjautunut", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 19, 331, 245, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Main", GUIEditor.tabpanel[1]) GUIEditor.label[1] = guiCreateLabel(6, 73, 283, 24, "Saldo:", false, GUIEditor.tab[1]) --[[ Need to get saldo, idk how.--]] guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetColor(GUIEditor.label[1], 18, 254, 0) guiLabelSetHorizontalAlign(GUIEditor.label[1], "left", true) GUIEditor.label[2] = guiCreateLabel(6, 194, 315, 17, "Made by: Sande // ", false, GUIEditor.tab[1]) GUIEditor.label[3] = guiCreateLabel(10, 0, 305, 56, "Kassakaappi", false, GUIEditor.tab[1]) guiSetFont(GUIEditor.label[3], "sa-header") GUIEditor.label[4] = guiCreateLabel(4, 103, 285, 28, "Owner:", false, GUIEditor.tab[1]) --[[ Owner of the safe --]] guiLabelSetColor(GUIEditor.label[4], 18, 254, 0) GUIEditor.button[1] = guiCreateButton(305, 0, 25, 24, "X", false, GUIEditor.tab[1]) --[[ GUI CLOSE BUTTON--]] GUIEditor.tab[2] = guiCreateTab("Deposit", GUIEditor.tabpanel[1]) GUIEditor.button[1] = guiCreateButton(84, 166, 169, 45, "Deposit", false, GUIEditor.tab[2]) --[[ Deposit button --]] GUIEditor.edit[1] = guiCreateEdit(84, 101, 169, 34, "", false, GUIEditor.tab[2]) --[[ Can write how much deposit --]] GUIEditor.label[5] = guiCreateLabel(89, 18, 160, 58, "Pano", false, GUIEditor.tab[2]) guiSetFont(GUIEditor.label[5], "sa-header") GUIEditor.label[6] = guiCreateLabel(38, 107, 70, 24, "Summa:", false, GUIEditor.tab[2]) GUIEditor.button[2] = guiCreateButton(84, 166, 169, 45, "Deposit", false, GUIEditor.tab[2]) GUIEditor.tab[3] = guiCreateTab("Withdraw", GUIEditor.tabpanel[1]) GUIEditor.button[3] = guiCreateButton(89, 167, 151, 44, "Withdraw", false, GUIEditor.tab[3]) --[[ Withdraw button --]] GUIEditor.label[7] = guiCreateLabel(89, 10, 151, 62, "Nosto", false, GUIEditor.tab[3]) guiSetFont(GUIEditor.label[7], "sa-header") GUIEditor.edit[2] = guiCreateEdit(88, 99, 152, 38, "", false, GUIEditor.tab[3]) --[[ Can write how much withdraw --]] GUIEditor.label[8] = guiCreateLabel(43, 109, 74, 31, "Summa:", false, GUIEditor.tab[3]) end )
  6. Hey, im try trigger something like this, but it says not working trigger or something can someone fix? Server: function ung() local team = getTeamFromName ("Unemployed") if (team) then setPlayerTeam ( source, team ) outputChatBox("Freeroam toiminnot kytketty pois käytöstä!, source, 0,255,0) end end addEvent( "un", true ) addEventHandler( "un", source, ung) Client: function eroa ( ) local team = getPlayerTeam ( localPlayer ) if getTeamName (team) == "Freeroam" then if getElementData ( localPlayer, "godmodeEnabled") == true then setElementData ( localPlayer, "godmodeEnabled", false ) executeCommandHandler("godmode-kaynnista-tullessa191") triggerServerEvent ( "un", localPlayer ) end end end addCommandHandler("poistuFR", eroa)
  7. Seems to me you copied it before i edit my post, copy the code again. Working, thank you so much
  8. end expected (to close if at line 7 near else
  9. Hey, i try to make this freeroam only, but the error message bugs. debugscript says: end expected to close if online 6. addCommandHandler("water", function ( command ) local team = getPlayerTeam (localPlayer) if getTeamName (team) == "Freeroam" then if not isWorldSpecialPropertyEnabled( "hovercars" ) then setWorldSpecialPropertyEnabled( "hovercars", true ) outputChatBox("Water drive: on ", 255, 255, 0 ) end else setWorldSpecialPropertyEnabled( "hovercars", false ) outputChatBox("Water drive: off", 255, 0, 0 ) else outputChatBox("Sinun täytyy olla freeroam tiimissä käyttääksesi lentotoimintoa", 255,0,0) end end end )
  10. Yes it working on my mtasa 1.3.2) testserver. But not in main server (1.3.3) and not second test server (1.3.3) so idk what wrong.
  11. Are there someway do that in clientside? If are can someone say how. (WITH OUT onClientRecourceStart)
  12. Hey, i try to start godmode with these script. This works on mtasa 1.3.2 but not 1.3.3. I didnt see any triggerClientEvent changes on wiki so whats wrong. Server: function godmode() local team = getPlayerTeam ( source ) if getTeamName (team) == "Freeroam" then triggerClientEvent(source, "goFreeroam", source) end end addEventHandler("onPlayerLogin", getRootElement(), godmode ) Client: addEvent("goFreeroam", true) addEventHandler("goFreeroam", root, function() executeCommandHandler("godmode") end )
  13. Does anyone know good event, when player join he gets godmode. Say if you know good event for that !
  14. Godmode turning on working, but when turn godmode on togglecontrols not goes false. and same when put godmode off toggle controls noes going back.
  15. Full script godModeEnabled = true function toggleGodMode() if getPlayerTeam (getLocalPlayer()) then local team = getPlayerTeam (getLocalPlayer()) if getTeamName (team) == "Freeroam" then godModeEnabled = not godModeEnabled if godModeEnabled then outputChatBox ("Godmode enabled!", 0, 255, 0, true) if getVehicleOccupant(getPedOccupiedVehicle(getLocalPlayer()), 0) == getLocalPlayer() then enableVehicleGodMode(getPedOccupiedVehicle(getLocalPlayer())) toggleControl ( "vehicle_fire", false ) toggleControl ( "vehicle_secondary_fire", false ) toggleControl ( "aim_weapon", false ) toggleControl ( "next_weapon", false) toggleControl ( "previous_weapon", false) toggleControl ( "fire", false) end else outputChatBox ("Godmode disabled!", 255, 0, 0, true) if getVehicleOccupant(getPedOccupiedVehicle(getLocalPlayer()), 0) == getLocalPlayer() then disableVehicleGodMode(getPedOccupiedVehicle(getLocalPlayer())) toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) toggleControl ( "aim_weapon", true ) toggleControl ( "next_weapon", true) toggleControl ( "previous_weapon", true) toggleControl ( "fire", true) end end end end end addCommandHandler("godmode", toggleGodMode) function playerDamageHandler() if getPlayerTeam (getLocalPlayer()) then local team = getPlayerTeam (getLocalPlayer()) if getTeamName (team) == "Freeroam" then if godModeEnabled and source == getLocalPlayer() then cancelEvent() end end end end addEventHandler("onClientPlayerDamage", getRootElement(), playerDamageHandler) function enableVehicleGodMode(vehicle) setVehicleDamageProof(vehicle, true) setVehicleFuelTankExplodable(vehicle, false) end function disableVehicleGodMode(vehicle) setVehicleDamageProof(vehicle, false) setVehicleFuelTankExplodable(vehicle, true) end function vehicleEnterHandler(vehicle, seat) if getPlayerTeam (getLocalPlayer()) then local team = getPlayerTeam (getLocalPlayer()) if getTeamName (team) == "Freeroam" then if godModeEnabled and seat == 0 then enableVehicleGodMode(vehicle) end end end end addEventHandler("onClientPlayerVehicleEnter", getRootElement(), vehicleEnterHandler)
  16. New code, but stil togglecontrol not working. (clientside) godModeEnabled = true function toggleGodMode() if getPlayerTeam (getLocalPlayer()) then local team = getPlayerTeam (getLocalPlayer()) if getTeamName (team) == "Freeroam" then godModeEnabled = not godModeEnabled if godModeEnabled then outputChatBox ("Godmode enabled!", 0, 255, 0, true) if getVehicleOccupant(getPedOccupiedVehicle(getLocalPlayer()), 0) == getLocalPlayer() then enableVehicleGodMode(getPedOccupiedVehicle(getLocalPlayer())) toggleControl ( vehicle_fire, false ) toggleControl ( vehicle_secondary_fire, false ) toggleControl ( aim_weapon, false ) toggleControl ( next_weapon, false) toggleControl ( previous_weapon, false) toggleControl ( fire, false) end else outputChatBox ("Godmode disabled!", 255, 0, 0, true) if getVehicleOccupant(getPedOccupiedVehicle(getLocalPlayer()), 0) == getLocalPlayer() then disableVehicleGodMode(getPedOccupiedVehicle(getLocalPlayer())) toggleControl ( vehicle_fire, true ) toggleControl ( vehicle_secondary_fire, true ) toggleControl ( aim_weapon, true ) toggleControl ( next_weapon, true) toggleControl ( previous_weapon, true) toggleControl ( fire, true) end end end end end addCommandHandler("godmode", toggleGodMode)
  17. I didnt post full script, i post only the "broken" area. So can someone make toggle controls work on this function?? (clientside)
  18. godModeEnabled = true function toggleGodMode() if getPlayerTeam (getLocalPlayer()) then local team = getPlayerTeam (getLocalPlayer()) if getTeamName (team) == "Freeroam" then godModeEnabled = not godModeEnabled if godModeEnabled then outputChatBox ("Godmode enabled!", 0, 255, 0, true) if getVehicleOccupant(getPedOccupiedVehicle(getLocalPlayer()), 0) == getLocalPlayer() then enableVehicleGodMode(getPedOccupiedVehicle(getLocalPlayer())) toggleControl ( "vehicle_fire", false ) toggleControl ( "vehicle_secondary_fire", false ) toggleControl ( "aim_weapon", false ) toggleControl ( "next_weapon", false) toggleControl ( "previous_weapon", false) toggleControl ( "fire", false) end else outputChatBox ("Godmode disabled!", 255, 0, 0, true) if getVehicleOccupant(getPedOccupiedVehicle(getLocalPlayer()), 0) == getLocalPlayer() then disableVehicleGodMode(getPedOccupiedVehicle(getLocalPlayer())) toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) toggleControl ( "aim_weapon", true ) toggleControl ( "next_weapon", true) toggleControl ( "previous_weapon", true) toggleControl ( "fire", true) end end end end end addCommandHandler("godmode", toggleGodMode) Not woorkk...
  19. Can someone fix this, something is wrong online 12. in togglecontrol (this is clientside) function toggleGodMode() if getPlayerTeam (getLocalPlayer()) then local team = getPlayerTeam (getLocalPlayer()) if getTeamName (team) == "Freeroam" then godModeEnabled = not godModeEnabled if godModeEnabled then outputChatBox ("Godmode enabled!", 0, 255, 0, true) if getVehicleOccupant(getPedOccupiedVehicle(getLocalPlayer()), 0) == getLocalPlayer() then enableVehicleGodMode(getPedOccupiedVehicle(getLocalPlayer())) toggleControl ( getLocalPlayer()), "vehicle_fire", false ) toggleControl ( getLocalPlayer()), "vehicle_secondary_fire", false ) toggleControl ( getLocalPlayer()), "aim_weapon", false ) toggleControl ( getLocalPlayer()), "next_weapon", false) toggleControl ( getLocalPlayer()), "previous_weapon", false) toggleControl ( getLocalPlayer()), "fire", false) end else outputChatBox ("Godmode disabled!", 255, 0, 0, true) if getVehicleOccupant(getPedOccupiedVehicle(getLocalPlayer()), 0) == getLocalPlayer() then disableVehicleGodMode(getPedOccupiedVehicle(getLocalPlayer())) toggleControl ( getLocalPlayer()), "vehicle_fire", true ) toggleControl ( getLocalPlayer()), "vehicle_secondary_fire", true ) toggleControl ( getLocalPlayer()), "aim_weapon", true ) toggleControl ( getLocalPlayer()), "next_weapon", true) toggleControl ( getLocalPlayer()), "previous_weapon", true) toggleControl ( getLocalPlayer()), "fire", true) end end end end end addCommandHandler("godmode", toggleGodMode)
  20. The function toggleGM is broken, the script not find it...
  21. Bad ARgument 2 in commandhandler onLine 50
×
×
  • Create New...