Jump to content

itHyperoX

Members
  • Posts

    522
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by itHyperoX

  1. itHyperoX

    Mute

    Hello guys. I made a script, which is mute player for x minutes. The script is working, but not unmute the player after the timer. Here is the script: addCommandHandler("muteplayer", function(player, cmd, name, minutes, ...) if (tonumber(getElementData(player, "account:admin")) >= 2) then local message = table.concat({ ... }, " ") if name and minutes then if tonumber(minutes) then if tonumber(minutes) > 0 then local target = exports.serverExport:findPlayer(name, player) if target then if message and #message > 0 then outputChatBox("#DC143C[Mute]:#7CC576 "..getPlayerName(target).." #ffffff has been muted by #7CC576"..getPlayerName(player).."#ffffff. #7CC576("..minutes.." Minutes)", cRoot, 255, 0, 0, true) outputChatBox("#DC143C[Mute]:#7CC576 Reason:#ffffff "..tostring(message), cRoot, 255, 0, 0, true) setPlayerMuted(target, true) setPlayerMuted(target, true, false, true, player, message, minutes * 60) else outputChatBox("#DC143C[Mute]:#6CB8FD "..getPlayerName(target).."#ffffff has been muted by #6CB8FD"..getPlayerName(player).."#ffffff. #7CC576("..minutes.." Minutes)", cRoot, 255, 0, 0, true) setPlayerMuted(target, true) setPlayerMuted(target, true, false, true, player, nil, minutes * 60) -- if no reason end else outputChatBox("Player not found.", player, 255, 0, 0, true) end else end else outputChatBox("Only numbers", player, 255, 0, 0, true) end else outputChatBox("/" ..cmd .. " [Player] [Minutes] [Reason]", player, 220, 220, 0, true) end else outputChatBox("You dont have permission.", player, 255, 255, 255,true) end end ) Whats the problem? Thanks any help!
  2. Thankyou man! I really appreciat!
  3. **NOT FIXED** this changing local player serial.. So anybody can help me please?
  4. Hi. I made a script, which is save player serial when they register to the server. I want to create script, for admins can change player serial when they reinstalled the windows and can't login their accounts. What i need? I saving the serial with setAccountData(getPlayerAccount(player),"account:protect",serial) Maybe what i need is looks like this: function changeserial(player,command,account, ...) local newSerial = table.concat({ ... }, " ") setAccountData(getPlayerAccount(account),"account:protect",newSerial) outputChatBox("You succesfully changed "..account.." serial to: "..newSerial,player,255,255,255,true) end addCommandHandler("changeserial",changeserial) Anybody can give me any example ? Fixed! function setAccountSerial(thePlayer,key,key,...) local account = getPlayerAccount(thePlayer) local newSerial = table.concat({ ... }, " ") if account and #newSerial > 0 then setAccountData(account,"account:protect",newSerial) end end addCommandHandler("changeserial",setAccountSerial)
  5. ERROR: test/server.lua:43 bad argument #1 to 'abs' (number expected, got nil edit: i dont have problem with this. I have problem, when player withdrawing negative numbers. i talking about this: You have $5000 in your bank. when you type /withdraw 500 , then /withdraw -5555 the server give you the money.
  6. function withdraw(player,cmd,number) local number = tonumber(number) local bankbalance = tonumber(getElementData(player, "account:bankbalance")) or 0 if not tonumber(number) then outputChatBox("#27B86C[USE]: #ffffff/" .. cmd .. " [Ammount]", player, 38, 194, 129, true) else if tonumber(bankbalance) <= 0 then outputChatBox("#B1092D[Error]: #ffffffYour bank balance is 0.", player, 177,9,45, true) elseif bankbalance >= tonumber(number) then givePlayerMoney(player,tonumber(number)) setElementData(player, "account:bankbalance", bankbalance - number) else outputChatBox("#B1092D[Error] #ffffffYou dont have enough money.", player, 177,9,45, true) end end end addCommandHandler("withdraw",withdraw) The problem is, when i depositing some money, like $500, and when i withdrawing like this: /withdraw -555555555555 the server give me thats money. But when the account balance is 0, i can't withdraw negative amount. How can i stop that, when player wihtdrawing -$500000000000 when the balance is in negavite ? I want thats, player ONLY can withdraw thats money, what they have on the account.
  7. itHyperoX

    a script

    You dont need that. function wasted (killer, weapon, bodypart) -- Input the name of the function local sound = playSound("sounds/winning.mp3") -- Play wasted.mp3 from the sounds folder setSoundVolume(sound, 1.0) -- set the sound volume to 100% outputChatBox ( #006600• #ffffff"..getPlayerName ( attacker ).." #006600is dangerous!"root,255,255,255,true) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) Try this
  8. You get the errors because someone using skin, which is don't have "bone". If you try on CJ, you can see.
  9. If you can start the resource, you can try the 'check <resource name> then upgrade <resource name> maybe..
  10. if you dont know what is the script do, please don't write here.
  11. I can give you easyer loader. Try with this: function loadSkin (filename,id) if id and filename then if fileExists(filename..".txd") then txd = engineLoadTXD( filename..".txd" ) engineImportTXD( txd, id ) end if fileExists(filename..".dff") then dff = engineLoadDFF( filename..".dff", 0 ) engineReplaceModel( dff, id ) end if fileExists(filename..".col") then col = engineLoadCOL( filename..".col" ) engineReplaceCOL( col, id ) end end end addEventHandler("onClientResourceStart", resourceRoot, function() loadSkin("cmodels/object",2242) -- Just add here your stuffs like: loadSkin("folder/name",ID) end)
  12. good luck with a h1z1 map dude
  13. @myonlake finally work. Thanks buddy.
  14. I dont want convert the number dude. I WANT to block that player can'not give money if lower than 0. If you see the picture, you see that! I want to block like this: /pay XYZ 0.0.14844 ONLY number!! like: /pay XYZ 646446
  15. i asked the problem, player,cmd,playername,money, ( cantidad ) what the ... is ?????
  16. attempt to 'compare' nil with number
  17. @#_iMr,[E]coo not working
  18. function pay_function(player,cmd,playername,money) if not (playername) or not tonumber(money) or not type(tonumber(money)) == "number" then outputChatBox("[Help]: #ffffff/" .. cmd .. " [Name] [Amount]", player, 255, 0, 0, true) else local targetPlayer = exports.enExport:findPlayer(playername, player) if targetPlayer then if (targetPlayer==player) then outputChatBox("[Error]: #ffffffYou cant give money to yourself.", player, 255, 0, 0, true) elseif tonumber(money) <= 0 then outputChatBox("[Error]: #ffffff Bigger than 0", player, 255, 0, 0, true) elseif getPlayerMoney(player) >= tonumber(money) then givePlayerMoney(targetPlayer,tonumber(money)) takePlayerMoney(player,tonumber(money)) outputChatBox("[PAY]: #ffffffYou gaved $" .. tostring(money) .. " to " ..getPlayerName(targetPlayer).. "", player, 255, 0, 0, true) outputChatBox("[PAY]: #ffffff"..getPlayerName(player).." #ffffff gaved you $" .. tostring(money) .. "", targetPlayer, 255, 0, 0, true) else outputChatBox("[Error] #ffffffyou dont have enough money.", player, 177,9,45, true) end end end end addCommandHandler("pay",pay_function) The problem is in the picture: Problem The problem is, i already added to the script ' type(tonumber(money)) == "number" then ' but the script is accept the 0.01.1.4.545 amount. What is this?
×
×
  • Create New...