Jump to content

Sande

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by Sande

  1. How much pays drugs? Do you have inventory system?? or something like that.
  2. Thanks, now i wanna do like if player element data is metromatkustaja he hear this voice when someone do that command. function kuulutus1() if getElementData ( localPlayer, "metroMatkustaja") == true then outputChatBox("[Metro] Hyvät matkustajat, jatkamme matkaa hetken kuluttua.", 0,255,0) local kuulutus = playSound("kuulutus/m1.mp3") setSoundVolume(kuulutus, 2.0) end end addCommandHandler("mkjatkammematkaa", kuulutus1 ) function kuulutus2() if getElementData ( localPlayer, "metroMatkustaja") == true then outputChatBox("[Metro] Hyvät matkustajat, junanvaihto olkaa hyvä ja vaihtakaa viereiseltä raiteelta lähtevään junaan.", 0,255,0) local kuulutus1 = playSound("kuulutus/m2.mp3") setSoundVolume(kuulutus1, 2.0) end end addCommandHandler("mkjvaihto", kuulutus2 ) function tila4(command) outputChatBox("Onnistui", 0,255,0) setElementData ( localPlayer, "metroMatkustaja", true ) end addCommandHandler("amission5", tila4 ) function tila3(command) outputChatBox("Onnistui", 0,255,0) setElementData ( localPlayer, "metroMatkustaja", false ) end addCommandHandler("amission6", tila3 )
  3. Hey, im trying to make train station voices with finnish voice, but the problem is that sounds not playing when i do the command, and elementData is "metroMatkustaja". Can someone help? Im also added files to meta.xml. Client: function kuulutus1() if getElementData ( localPlayer, "metroMatkustaja") == true then outputChatBox("[Metro] Hyvät matkustajat, jatkamme matkaa hetken kuluttua.", 0,255,0) local kuulutus = playSound("kuulutus/m1.mp3") setSoundVolume(kuulutus, 2.0) end end addCommandHandler("mkjatkammematkaa", kuulutus1 ) function kuulutus2() if getElementData ( localPlayer, "metroMatkustaja") == true then outputChatBox("[Metro] Hyvät matkustajat, junanvaihto olkaa hyvä ja vaihtakaa viereiseltä raiteelta lähtevään junaan.", 0,255,0) local kuulutus1 = playSound("kuulutus/m2.mp3") setSoundVolume(kuulutus1, 2.0) end end addCommandHandler("mkjvaihto", kuulutus2 ) function tila4(thePlayer, command) outputChatBox("Onnistui", source, 0,255,0) setElementData ( thePlayer, "metroMatkustaja", true ) end addCommandHandler("amission5", tila4 ) function tila3(thePlayer, command) outputChatBox("Onnistui", source, 0,255,0) setElementData ( thePlayer, "metroMatkustaja", false ) end addCommandHandler("amission6", tila3 )
  4. Thanks tapl, that works
  5. The problem is now, players who not jailed, or arrested not get money or the sound. function finishCasinoRobbery ( ) for robber, _ in pairs ( robbers ) do if ( isElement ( robber ) ) then if exports [ "cops" ]:isPlayerJailed ( robber ) then outputChatBox("[Casino-robbery] You are in jail, so you do not get the reward.", robber, 255, 0, 0) return end if exports [ "cops" ]:isPlayerArrested ( robber ) then outputChatBox("[Casino-robbery] You are handcuffed, so you do not get the reward.", robber, 255, 0, 0) return end givePlayerMoney ( robber, reward ) outputChatBox ( "Casino Robbery: You successfully robbed the casino, you got $".. reward ..".", robber, 0, 255, 0 ) triggerClientEvent ( "soitaMusa1", robber ) end stopCasinoRobbery ( ) end end
  6. Hey, i wanna do like if player jailed, it not give reward. But now theres something wrong can someone fix=?! thanks! function finishCasinoRobbery ( ) for robber, _ in pairs ( robbers ) do if ( isElement ( robber ) ) then if exports [ "cops" ]:isPlayerJailed ( robber ) then outputChatBox("[Casino-robbery] You are in jail, so you do not get the reward.", robber, 255, 0, 0) return end if exports [ "cops" ]:isPlayerArrested ( robber ) then outputChatBox("[Casino-robbery] You are handcuffed, so you do not get the reward.", robber, 255, 0, 0) return end else givePlayerMoney ( robber, reward ) outputChatBox ( "Casino Robbery: You successfully robbed the casino, you got $".. reward ..".", robber, 0, 255, 0 ) triggerClientEvent ( "soitaMusa", robber ) end stopCasinoRobbery ( ) end end
  7. Theres many other servers too what got that features..
  8. Il posted ideas, what Mr.prestege can make.
  9. Bank robbery, Casino robbery, Drugs, Inventory
  10. No problem anymore, i made it with other strategy.
  11. New code, are there someway when player robbed goes 1h time, and then it again avaible. function resourceStart () robMarker = createMarker (252.12193, -56.73697, 1.57031, "cylinder", 1.5, 255, 255, 0, 127 ) --[[setElementInterior (robMarker, 3)--]] end addEventHandler ("onResourceStart", getRootElement (), resourceStart) function robHit (hitPlayer, matchingDimesion ) if (source == robMarker ) then local team = getPlayerTeam ( hitPlayer ) if team and getTeamName (team) == "Criminal" then local rnd = math.random(3000,15000) givePlayerMoney(hitPlayer, rnd) setPlayerWantedLevel(hitPlayer, 6) outputChatBox("[ROB4] Ryöstit likööri liikkeen sait "..(rnd).." rahaa.", hitPlayer, 0,255,0) outputChatBox("[ROB4] Pelaaja "..(getPlayername ( hitPlayer ) ).." ryösti viinakaupan ja sai 6 tähteä!", root, 255,0,0) end end end addEventHandler ("onMarkerHit", getRootElement(), robHit)
  12. I try to make store robbing, all other works but the price giving not working. Can some one fix? And i need some info how can make this robbery avaible on every 1h. function resourceStart () robMarker = createMarker (252.12193, -56.73697, 1.57031, "cylinder", 1.5, 255, 255, 0, 127, getRootElement()) --[[setElementInterior (robMarker, 3)--]] end addEventHandler ("onResourceStart", getRootElement (), resourceStart) function robHit (hitPlayer, matchingDimesion ) if (source == robMarker ) then local team = getPlayerTeam ( hitPlayer ) if getTeamName (team) == "Criminal" then outputChatBox("Kirjoita /rob4 ryöstääksesi tämän kohteen. Muista olla punaisessa ympyrässä jotta ryöstö alkaa!", hitPlayer, 0,255,0) end end end addEventHandler ("onMarkerHit", getRootElement(), robHit) function timer(thePlayer) outputChatBox("[ROB4] Holvi aukeaa 1min kuluttua.",source,0,255,0) setTimer (startRob, 6000, 1 ) end addCommandHandler("rob4", timer ) function startRob() if (source == robMarker ) then local team = getPlayerTeam ( source ) if getTeamName (team) == "Criminal" then local rnd = math.random(3000,15000) givePlayerMoney(source, rnd) setPlayerWantedLevel(source, 6) outputChatBox("[ROB4] Ryöstit likööri liikkeen sait jonkunverran rahaa.", source, 0,255,0) outputChatBox("[ROB4] Pelaaja "..(source).." ryösti viinakaupan ja sai 6 tähteä!",255,0,0) end end end --[[(252.12193 -56.73697 )--]]
  13. I making Haystack for freeroam, but this "jetpack" checker not working. function secure() for i, v in ipairs(getElementsByType("player")) do if getElementData(v, "Hay") == true then if doesPedHaveJetPack( v ) then removePedJetPack( v ) end end end end function tarkistaja() setTimer (secure, 100, 0) end addEventHandler ("onRecourceStart", getRootElement(), tarkistaja)
  14. Hey, theres something wrong can someone fix? Error: attempt to compare number to string if (getAccountData (getPlayerAccount (thePlayer), "nordea-cash" >= tonumber (amount)) and (tonumber (amount) > 0)) then function tilisiirto2 ( thePlayer, command, target, amount ) local target = getPlayerFromName ( target ) if ( target ) then if not (isGuestAccount (getPlayerAccount (thePlayer))) then if (getAccountData (getPlayerAccount (target), "nordea-cash")) then if (getAccountData (getPlayerAccount (thePlayer), "nordea-cash" >= tonumber (amount)) and (tonumber (amount) > 0)) then local money = (tonumber(getAccountData (getPlayerAccount (target), "nordea-cash")) + tonumber (amount)) setAccountData (getPlayerAccount (target), "nordea-cash", tonumber(money)) --[[ + money to target --]] local money1 = (tonumber(getAccountData (getPlayerAccount (thePlayer), "nordea-cash")) - tonumber (amount)) --[[ - money to sender--]] setAccountData (getPlayerAccount (thePlayer), "nordea-cash", tonumber(money1)) outputChatBox ("#0000FF[Nordea]#00FF00 "..(amount).."$ siirretty pelaajan "..getPlayerName(target).." tilille.", thePlayer, 0, 255, 0, true) outputChatBox ("#0000FF[Nordea]#00FF00 Sait "..(amount).."$ pelaajalta "..getPlayerName(thePlayer).." tilillesi.", target, 0,255,0, true) bankSayAmount = getAccountData (getPlayerAccount (target), "nordea-cash") if (bankSayAmount) then outputChatBox ("#ffff00[Nordea]#FFFF00 Uusi saldo on " .. tostring(bankSayAmount) .. "$", target, 255, 255, 0, true) else outputChatBox ("#0000FF[Nordea]#FF0000 Syöttämäsi rahamäärä ei ole kelvollinen.", thePlayer, 255, 0, 0, true) end end end end end end addCommandHandler("tilisiirto", tilisiirto2 )
  15. No problem anymore, thanks.
  16. I wanna it like, [Nordea] is blue, and the testi1 text is green. now it works but all is now blue.
  17. I got so little, problem. I want the [Nordea] is blue, but when i run the code its green all. outputChatBox("#ffff00[Nordea]testi1", thePlayer, 0,255,0) outputChatBox("#0000ff[Nordea]testi", thePlayer, 0,255,0)
  18. Working, but messages not working
  19. ERROR: line 98, attempt to contacte local target a (userdata value)
  20. givePlayerMoney (target, commandName, tonumber(amount)) Not work, or i didnt understand. Please stuck it to the code.
  21. I am made nordea command bank system, and this transfer command not work. No errors. please help. function tilisiirto ( thePlayer, target, command, amount ) local target = getPlayerFromName ( target ) if ( target ) then if not (isGuestAccount (getPlayerAccount (thePlayer))) then if (getAccountData (getPlayerAccount (thePlayer), "nordea-cash")) then if (getAccountData (getPlayerAccount (thePlayer), "nordea-cash") >= tonumber (amount)) and (tonumber (amount) > 0) then local money = (tonumber(getAccountData (getPlayerAccount (thePlayer), "nordea-cash")) - tonumber (amount)) setAccountData (getPlayerAccount (thePlayer), "nordea-cash", tonumber(money)) givePlayerMoney (target, tonumber(amount)) outputChatBox ( tostring (amount) .. "$ nostettu tililtä, ja annettu pelaajaalle "..(target)..".", thePlayer, 0, 255, 0, false) outputChatBox ( tostring (amount) .. "$ Antoi sinulle pelaaja "..getPlayerName(thePlayer)..".", target, 0,255,0) else outputChatBox ("[Nordea]Et voi siirtää enempää mitä sinulla pankkitilillä on!", thePlayer, 255, 0, 0, false) end else outputChatBox ("[Nordea]Käyttäjä luotu!", thePlayer, 255, 0, 0, false) outputChatBox ("[Nordea]Pankki antaa sinulle 250$ tervetulolahjaksi!", thePlayer, 255, 0, 0, false) setAccountData (getPlayerAccount (thePlayer), "nordea-cash", 250) end end end end addCommandHandler("siirto", tilisiirto )
  22. Now i got something in my mind, now only withdraw, and saldo check not work. It says something bad in getaccount data can someone fix please? 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) givePlayerMoney (getPlayerFromName("Vlack"), 4000) outputChatBox("[CLUB-MANAGER] Pelaaja "..getPlayerName(thePlayer).." osti lipun.", getPlayerFromName("Vlack"), 0,255,0) 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 "..(amount).."$", thePlayer, 0,255,0) end end addCommandHandler("pano",setMoney) function nosta(thePlayer,key,amount) --[[ Bank withdraw --]] local cash = getAccountData(thePlayer, "nordea-cash",amount) if (cash) then givePlayerMoney(thePlayer, amount ) outputChatBox("[NORDEA] Nostit tililtäsi rahaa: "..(amount).."$", thePlayer, 0,255,0) end end addCommandHandler("nosto", nosta ) function saldo(thePlayer,key,amount) --[[ Bank withdraw --]] local cash = getAccountData(thePlayer, "nordea-cash",amount) if (cash) then outputChatBox("[NORDEA] Sinulla on tililläsi "..(amount).."$", thePlayer, 0,255,0) end end addCommandHandler("saldo", saldo)
×
×
  • Create New...