Search the Community
Showing results for tags 'pay'.
-
This is the code: function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end else return false end end function payScript(player,cmd,other,amount) local name = getPlayerFromPartialName(other) local atg local rpm = getPlayerMoney(player) local err = {} local penz = getElementData(player,"char:money") or 0 if name == false then err[#err+1] = "#FFffFFA név nem található!" end if tonumber(amount) < 0 then err[#err+1] = "#FFffFFNegatív szám nem lehet!" end atg = tonumber(amount) if (penz-atg) < 0 then err[#err+1] = "#FFffFFNincs elég pénzed!" end if(player == name) then err[#err+1] = "# nem tudsz." end if #err == 0 then setElementData(player,"char:money",penz-atg) setElementData(name,"char:money",atg+penz) else for i=1,#err do end end end addCommandHandler( "pay", payScript ) the other and the local player's money changes to the same... how to fix this??
-
السلام عليكم ورحمة الله وبركاته بما اني متفرغ هذي الايام فقررت استرزق شوي حاليا انا متفرغ دايما ابي ابرمج اي شي ولاكن طبعا بمقابل سوا وعلي حسب نوعية السكربت صحيح اني مش مبرمج الي هوا محترف ولاكن ما رح اقصر معك ولاكن ببرمجلك السكربت وبتخش تشوفه قبل م تاخذه بسيرفري حق البرمجة والي هو اسمه ( [ > سيرفر هيمو لبرمجة السكربتات ] skype= live:kdark8703 ) رح تخش تجرب سكربتك فيه وبتاخذ السكربت قبل الدفع طرق التواصل skype : live:kdark8703 facebook :Click Here ___________________________________
-
Hello! I wanna buy an Inventory system for my server. I wanna it like this: I want it to be 2 screens. One for the items in the ground and another for the player's items. And I also want a scroll bar (like a gridlist with the items) EVERYTHING ON DXDRAW. Send me your price on a PRIVATE MESSAGE or on my STEAM: steamcommunity.com/id/erknnetobr Sorry for my bad english. I can pay with PAYPAL or a Steam Game.
-
function findPlayer(name) local matches = {} for i,v in ipairs(getElementsByType("player")) do if getPlayerName(v) == name then return v end local playerName = getPlayerName(v):gsub("#%x%x%x%x%x%x", "") playerName = playerName:lower() if playerName:find(name:lower(), 0) then table.insert(matches, v) end end if #matches == 1 then return matches[1] end return false end addCommandHandler("pay", function(player, cmd, name, amount) local amount = tonumber(amount) if name and amount then local target = findPlayer(name) local money = getPlayerMoney(target) if money >= amount then takePlayerMoney(player, amount) givePlayerMoney(target, amount) outputChatBox("#FFffFF Átutaltál neki: #c8c8c8" .. getPlayerName(target) .. " #0088ff" .. amount .. " Forintot.", player, 0, 255, 0, true) outputChatBox("#c8c8c8 " .. getPlayerName(player) .. " #FFffFFutalt neked #0088ff" .. amount .. " Forintot.", target, 0, 255, 0, true) else outputChatBox("#FFffFF Nincs elég pénzed.", target, 255, 0, 0, true) end end end ) why can i 'pay' minus amount? how to fix this?
-
function payScript(player,cmd,other,amount) local money = getPlayerMoney(player) local otherPlayer = getPlayerFromName(other) if not other or not amount then outputChatBox("#00BAFF[Play] #FFffFFHelyes használat: #0088FF/pay <név> <összeg>!",player,0,255,255, true) end if ((money - amount) < 0) then outputChatBox("#00BAFF[Play] #FFffFFNincs elegendő #0088FFpénzed!",player,0,255,255, true) return else setPlayerMoney(otherPlayer,getPlayerMoney(otherPlayer) + amount) setPlayerMoney(player,money - amount) outputChatBox("#00bAFF[Play] #0088FF"..amount.."Ft-ot #FFffFFküldtél neki: #0088FF"..other.."!",player,0,255,255, true) outputChatBox("#00BAFF[Play] #FFffFFKaptál #0088FF"..amount.."Ft-ot #FFffFFtőle: #0088FF"..getPlayerName(player).."!",otherPlayer,0,255,255,true) end end addCommandHandler("pay",payScript) and i got this error: xy.lua:11: attempt to perform arithmetic on a boolean value how to fix this?
-
Hi guys, need your help. Need scripter for DM(race) servers. In a lot of different plans, including scripts. Trying to find the scripter for the project, but I can't>< Looking for scripter for a permanent job! If u will to free work,u will accepted in clan Co-Leader, will be given all access to everything, as you will be considered by the developer. This is your chance to create a good and can be a unique project. The problem is that I would realises these plans, BUT I really don't amenable to scripting. In General, I hope that everything will be fine and I'll find the scripter My skype: niobium101 Have a nice day!