Jump to content

Chris!i!

Members
  • Posts

    213
  • Joined

  • Last visited

Everything posted by Chris!i!

  1. It needs 2 buttons to be disabled the button why
  2. I changed it because it still didnt work.
  3. It still give me same error. I've changed the script its not this addEventHandler("onClientGUIClick", GUIEditor.button[1], function() setElementData(localPlayer, "anti.repeater", true) if ( getElementData(localPlayer, "anti.repeater") == true ) then timer[source] = setTimer( function() guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) setElementData(localPlayer, "anti.repeater", false) removeEventHandler("onClientGUIClick", GUIEditor.button[1], cancelShots) end, 10000, 1 ) addEventHandler("onClientGUIClick", GUIEditor.button[1], cancelShots) end end end) --HERE IT GIVES ME ERROR ) EXPECTED TO CLOSE THE FUNCTION function cancelShots() if source == GUIEditor.button[1] then guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) else guiSetProperty( GUIEditor.button[1], "Disabled", "True" ) end end
  4. function cancelShots() if source == GUIEditor.button[1] then guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) else guiSetProperty( GUIEditor.button[1], "Disabled", "True" ) end end Okay so, i've added an If statement, still didn't work.
  5. timer = {} function cancelShots() guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) else guiSetProperty( GUIEditor.button[1], "Disabled", "True" ) end addEventHandler("onClientGUIClick", GUIEditor.button[1], localPlayer, function() setElementData(localPlayer, "anti.repeater", true); if ( getElementData(localPlayer, "anti.repeater") == true ) then timer[source] = setTimer( function() guiSetProperty( GUIEditor.button[1], "Disabled", "False" ) setElementData(localPlayer, "anti.repeater", false) removeEventHandler("onClientGUIClick", GUIEditor.button[1], cancelShots) end, 10000, 1 ) addEventHandler("onClientGUIClick", GUIEditor.button[1], cancelShots) end end Client Sided. I'm setting an no spam function for a button, it says end expected to close function at line 1, the function cancelShots. It needs end replacing "else" but i wont remove else. Thanks for your help.
  6. Use getElementPosition Then Add + 5 to x and y.
  7. ----------------------------------------->> -- Grand Theft International (CST) -- Author: JT Pennington (JTPenn) -- Date: 29 Aug 2014 -- Resource: CSTbank/accounts.slua -- Version: 1.0 ----------------------------------------->> addEvent("onPlayerGiveMoney", true) addEvent("onPlayerTakeMoney", true) START_CASH = 10000 -- Starting Cash for new accounts START_BANK_BALANCE = 500000000 -- Starting bank balance -- Get Bank Accounts --------------------->> function getBankAccounts(player) if (not isElement(player)) then return false end if (not exports.CSTutils:isPlayerLoggedIn(player)) then return false end local bank_acc = {} -- Main Account local account = getPlayerAccount(player) local acc_name = getAccountName(account).."'s Main Account" local balance = getPlayerBankBalance(player) local acc_number = getBankData(account, "acc_number") if (not acc_number) then acc_number = getRealTime().timestamp acc_number = string.format("%012d", acc_number) setBankData(account, "acc_number", acc_number) end local last_trans = getPlayerLastBankTransaction(player) if (last_trans) then local day,mo,yr = exports.CSTutils:todate(last_trans) local day,mo = string.format("%02d", day), string.format("%02d", mo) local hr,min,sec = exports.CSTutils:totime(last_trans) local hr,min,sec = string.format("%02d", hr), string.format("%02d", min), string.format("%02d", sec) last_trans = yr.."-"..mo.."-"..day.." at "..hr..":"..min..":"..sec end table.insert(bank_acc, {acc_name, acc_number, last_trans, balance}) -- Group Account local groupID = exports.CSTgroups:getPlayerGroup(player) if (groupID) then local acc_name = exports.CSTgroups:getPlayerGroup(player).."'s Group Account" local balance = getGroupBankBalance(groupID) local last_trans = getGroupLastBankTransaction(groupID) if (last_trans) then local day,mo,yr = exports.CSTutils:todate(last_trans) local day,mo = string.format("%02d", day), string.format("%02d", mo) local hr,min,sec = exports.CSTutils:totime(last_trans) local hr,min,sec = string.format("%02d", hr), string.format("%02d", min), string.format("%02d", sec) last_trans = yr.."-"..mo.."-"..day.." at "..hr..":"..min..":"..sec end table.insert(bank_acc, {acc_name, acc_number, last_trans, balance}) end return bank_acc end -- Give/Take Money ------------------->> function GPM(player, amount, log, bonus) if (not isElement(player) or type(amount) ~= "number" or amount < 0 or not log) then return false end amount = math.floor(amount) if (amount == 0) then return false end local old_amount = amount givePlayerMoney(player, amount) exports.CSTlogs:outputServerLog("GPM: "..getPlayerName(player).." +$"..amount.." ("..log..")", "money", player) addLogToDatabase("cash", getRealTime().timestamp, log, amount, getPlayerMoney(player), player, getAccountName(getPlayerAccount(player))) local cash = getPlayerMoney(player) setBankData(getPlayerAccount(player), "cash", cash) local earned = getBankData(getPlayerAccount(player), "cash_earned" ) or 0 setBankData(getPlayerAccount(player), "cash_earned", amount + earned ) triggerEvent("onPlayerGiveMoney", player, amount) triggerClientEvent(player, "onClientPlayerGiveMoney", player, amount) -- Global Money Given Log local mGiven = exports.CSTserver:getServerStat("money_given") or 0 if not mGiven == 0 then exports.CSTserver:setServerStat("money_given", amount) else exports.CSTserver:modifyServerStat("money_given", amount) end return true end function TPM(player, amount, log, premium) if (not isElement(player) or type(amount) ~= "number" or amount < 0 or not log) then return false end amount = math.floor(amount) if (amount == 0) then return false end takePlayerMoney(player, amount) exports.CSTlogs:outputServerLog("TPM: "..getPlayerName(player).." +$"..amount.." ("..log..")", "money", player) addLogToDatabase("cash", getRealTime().timestamp, log, -amount, getPlayerMoney(player), player, getAccountName(getPlayerAccount(player))) local cash = getPlayerMoney(player) setBankData(getPlayerAccount(player), "cash", cash) local spent = getBankData(getPlayerAccount(player), "cash_spent" ) or 0 setBankData(getPlayerAccount(player), "cash_spent", amount + spent ) triggerEvent("onPlayerTakeMoney", player, amount) triggerClientEvent(player, "onClientPlayerTakeMoney", player, amount) -- Global Money Taken Log local mTaken = exports.CSTserver:getServerStat("money_taken") or 0 if mTaken == 0 then exports.CSTserver:setServerStat("money_taken", amount) else exports.CSTserver:modifyServerStat("money_taken", amount) end return true end -- Player Bank Balance ----------------------->> function getPlayerBankBalance(player) if (not isElement(player)) then return false end local account = getPlayerAccount(player) if (isGuestAccount(account)) then return false end local balance = getBankData(account, "balance") or 0 return balance end function modifyPlayerBankBalance(player, amount, log, bonus) if (not isElement(player) or type(amount) ~= "number" or not log) then return false end local account = getPlayerAccount(player) if (isGuestAccount(account)) then return false end amount = math.floor(amount) if (amount == 0) then return false end local old_amount = amount local balance = getBankData(account, "balance") or 0 setBankData(account, "balance", balance+amount) setBankData(account, "last_transaction", getRealTime().timestamp) addLogToDatabase("bank", getRealTime().timestamp, log, amount, balance+amount, player, getAccountName(getPlayerAccount(player))) amount = math.abs(amount) exports.CSTlogs:outputServerLog("BANK: "..getPlayerName(player).." balance changed by "..(amount >= 0 and "$"..amount or "-$"..amount).." ("..log..")", "bank", player) return true end function modifyAccountBankBalance(account, amount, log) if (not account or isGuestAccount(account) or type(amount) ~= "number" or not log) then return false end amount = math.floor(amount) if (amount == 0) then return false end local balance = getBankData(account, "balance") or 0 setBankData(account, "balance", balance+amount) setBankData(account, "last_transaction", getRealTime().timestamp) addLogToDatabase("bank", getRealTime().timestamp, log, amount, balance+amount, player, getAccountName(account)) amount = math.abs(amount) exports.CSTlogs:outputServerLog("BANK: "..getAccountName(account).." balance changed by "..(amount >= 0 and "$"..amount or "-$"..amount).." ("..log..")", "bank") return true end function getPlayerLastBankTransaction(player) if (not isElement(player)) then return false end local account = getPlayerAccount(player) if (isGuestAccount(account)) then return false end return getBankData(account, "last_transaction") or false end -- Group Bank Balance ---------------------->> function getGroupBankBalance(groupID) if (type(groupID) ~= "number") then return false end local groupName = exports.CSTgroups:getGroupName(groupID) if (not groupName) then return false end local balance = exports.CSTgroups:getGroupData(groupID, "bank.balance") or 0 return balance end function modifyGroupBankBalance(groupID, amount, log) if (type(groupID) ~= "number" or type(amount) ~= "number" or not log) then return false end local groupName = exports.CSTgroups:getGroupName(groupID) if (not groupName) then return false end amount = math.floor(amount) if (amount == 0) then return false end local balance = getGroupBankBalance(groupID) exports.CSTgroups:setGroupData(groupID, "bank.balance", balance+amount) exports.CSTgroups:setGroupData(groupID, "bank.last_transaction", getRealTime().timestamp) addLogToDatabase("groupbank", getRealTime().timestamp, log, amount, balance+amount, nil, groupID) amount = math.abs(amount) exports.CSTlogs:outputServerLog("GROUP: "..groupName.." balance changed by "..(amount >= 0 and "$"..amount or "-$"..amount).." ("..log..")", "group") return true end function getGroupLastBankTransaction(groupID) if (type(groupID) ~= "number") then return false end local groupName = exports.CSTgroups:getGroupName(groupID) if (not groupName) then return false end return exports.CSTgroups:getGroupData(groupID, "bank.last_transaction") or false end -- Load Cash ------------->> addEventHandler("onPlayerLogin", root, function(_, account) if (isGuestAccount(account)) then return end local balance = getBankData(account, "balance") if (not balance) then setBankData(account, "balance", START_BANK_BALANCE) end end) addEventHandler("onResourceStart", root, function(_, account) if (isGuestAccount(account)) then return end local balance = getBankData(account, "balance") if (not balance) then setBankData(account, "balance", START_BANK_BALANCE) end end) function initResource(plr) for index, players in pairs(getElementsByType("player")) do
  8. Well i fixed money, for clientside it must takePlayerMoney(amount) CodyL no. Now giveWeapon left!
  9. no lol my button variable name is GUIEditor.button[1] i was too lazy so i typed button[1]
  10. Client Side function deal () local localPlayer = getLocalPlayer() triggerServerEvent ( "iWantToBuyThis", localPlayer ) local money = getPlayerMoney ( localPlayer ) if money > 200000 then takePlayerMoney ( localPlayer, 200000 ) end end addEventHandler ( "onClientGUIClick", GUIEditor.button[1], deal ) server side function iWantToBuyThis ( source ) giveWeapon ( source, 35, 20 ) end addEvent( "iWantToBuyThis", true ) addEventHandler( "iWantToBuyThis", resourceRoot, iWantToBuyThis ) When i press the button[1] nothing happens, it doesnt even take money. And nothing and yes i have enough money and i dont get the weapon..
  11. Remon u sayin shi t DDoS and idk, u dont even know what scripting means.
  12. None stole anything, remon your just saying this because maybe? the 2 servers have same scripts okay anyway, both of you didnt make 1 script from those scripts, so NONE is allowed to say u hacked me, it's Arran's scripts.
  13. Hello, my friend has a free server online that gets 20+ players everyday. He hosted it for free and it is TOO fast. Can i know where can i host a free one?
  14. Chris!i!

    DUP Output

    U serious dude, post the code
  15. U can see the weapon?? or there is no weapon? is there any errors?
  16. Wait im so sorry, i meant client side i forgt sorry so there is a way?
  17. Well i was trying to do a ping kicker, i want it if He's a guest ( not logged in ) he wont get kicked i tried using triggerClientEvent didnt work wiith me, is there anyway to check if player is logged in in "SERVER" side? If yes can you give me any example please
  18. function bindFire () local x, y, z = getElementPosition ( source ) local rotX, rotY, rotZ = getElementRotation(source) attachElements ( weapon, source, 0, 0.3, 0.2 ) setElementRotation(weapon,rotX,rotY,rotZ+43) end addEvent( "bindFire", true ) addEventHandler( "bindFire", localPlayer, bindFire )
  19. Im sorry i didnt understand what u mean ..
  20. function checkLagger( duration ) for index,projectile in ipairs( getElementsByType( "projectile" ) ) do setProjectileCounter( projectile, duration * 3243254 ) end end addEventHandler( "onClientResourceStart", getRootElement(), checkLagger ) Tried this too, didnt work what is wrong?
  21. function checkLagger( bombIndex, duration ) local bombIndex = tonumber( bombIndex ) or nil local duration = tonumber( duration ) or nil if ( bombIndex ) and ( duration ) then local found = false for index,projectile in ipairs( getElementsByType( "projectile" ) ) do if ( index == bombIndex ) then setProjectileCounter( projectile, duration * 50 ) found = true break if ( not found ) then outputChatBox( "Projectile with index " .. bombIndex .. " was not found.", 255, 0, 0, false ) end end end end end addEventHandler( "onClientResourceStart", getRootElement(), checkLagger ) function name doesnt matter. I need this to be fixed.., whats wrong?? The grenade still bomb at the default MTA timer..
  22. local thePlayer = getLocalPlayer() function checkSilenced ( ) local weapon = getPedWeapon ( thePlayer ) if weapon == 23 then toggleControl ( "fire", false ) toggleControl ( "aim_weapon", false ) end end addEventHandler ( "onClientResourceStart", getRootElement(), checkSilenced )
×
×
  • Create New...