-
Posts
439 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Turbe$Z
-
working the minus value, but now the script, when i type for example (i have 99.999.999$) and i type /pay xyplayer 1 , everyone money has going to 64k$, then i type again, and the my money +1, and doesn't send the money to the other player. how to fix this bug? (sorry for my bad English:()
-
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?
-
function aAction ( type, action, admin, player, data, more ) if ( aLogMessages[type] ) then function aStripString ( string ) string = tostring ( string ) string = string.gsub ( string, "$admin", getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) string = string.gsub ( string, "$by_admin_4all", isAnonAdmin4All( admin ) and "" or " by " .. getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) string = string.gsub ( string, "$by_admin_4plr", isAnonAdmin4Victim( admin ) and "" or " by " .. getPlayerName ( admin ):gsub("#%x%x%x%x%x%x","") ) string = string.gsub ( string, "$data2", more or "" ) if ( player ) then string = string.gsub ( string, "$player", getPlayerName ( player ) ) string = string:gsub("#%x%x%x%x%x%x","") end return tostring ( string.gsub ( string, "$data", data or "" ) ) end local node = aLogMessages[type][action] if ( node ) then local r, g, b = node["r"], node["g"], node["b"] if ( node["all"] ) then outputChatBox ( aStripString ( node["all"] ), _root, r, g, b ) end if ( node["admin"] ) and ( admin ~= player ) then outputChatBox ( aStripString ( node["admin"] ), admin, r, g, b ) end if ( node["player"] ) then outputChatBox ( aStripString ( node["player"] ), player, r, g, b ) end if ( node["log"] ) then outputServerLog ( aStripString ( node["log"] ) ) end end end end i added this lines to 'admin_server.lua', but doesn't working the script i got a lot of errors from 'admin_sync.lua':194: attempt to index global 'aPlayers' (a nil value) and rom 'admin serverjoiner.lua':48: attempt to call global 'checkClient' (a nil value) but when i add the original 'aActions' function, the errors will disappear. why? how to fix this?
-
addEventHandler("onPlayerLogin", getRootElement(), function () local name = getPlayerName ( source ) name:gsub("#%x%x%x%x%x%x", "") if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then exports[getResourceName(resource)]:addNotification(root, name.." tulajdonos szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Moderator")) then exports[getResourceName(resource)]:addNotification(root, name.." moderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("SuperModerator")) then exports[getResourceName(resource)]:addNotification(root, name.." szupermoderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Modi")) then exports[getResourceName(resource)]:addNotification(root, name.." moderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Operator")) then exports[getResourceName(resource)]:addNotification(root, name.." operátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("zuker")) then exports[getResourceName(resource)]:addNotification(root, name.." moderátor szolgálatba lépett!", "warning") elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Adminseged")) then exports[getResourceName(resource)]:addNotification(root, name.." adminsegéd szolgálatba lépett!", "warning") end end ) i added 'gsub' but the color code not disappear
-
addEventHandler ( "onElementModelChange", root, function ( oldModel, newModel ) local account = getPlayerAccount ( source ) local accountName = getAccountName ( account ) if ( newModel == 60 and not isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then outputChatBox ( "Bocsi, de ez admin skin. Te nem használhatod! :(", source, r, g, b ) setElementData ( source, oldModel ) end end ) outputChatBox is working fine, but the player can change his skin to 60 no errors/warnings in debugscript How to fix this?
-
when I am far from other players, the 'admin' in my code is move from my head dxDrawColorText ("#00BAFF" .. getPlayerName(player) .. " " .. state, sx-w, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), player ~= g_Me and textscale*NAMETAG_TEXTSIZE or (textscale*NAMETAG_TEXTSIZE)/1.5, srfont, "center", "bottom", false, false, false ) local drawX = sx - NAMETAG_WIDTH*scale/2 dxDrawColorText (admin, sx-34, sy - offset, sx, sy - offset-64, tocolor(0,0,0,255), textscale*NAMETAG_TEXTSIZE or (textscale*NAMETAG_TEXTSIZE)/1.5, srfont, "center", "center", false, false, false ) local drawX = sx - NAMETAG_WIDTH*scale/2 dxDrawColorText (admin, sx-35, sy - offset, sx, sy - offset-65, tocolor(255,255,255,255), textscale*NAMETAG_TEXTSIZE or (textscale*NAMETAG_TEXTSIZE)/1.5, srfont, "center", "center", false, false, false ) local drawX = sx - NAMETAG_WIDTH*scale/2 how to fix this? i tried change everything to "center" but not good
-
addCommandHandler (server) has 2 main parameters player playerSource, string commandName, [string arg1, string arg2, ...] so it should be: function kivesz (player, command) then you can use player for your functions instead of source or can just change player to source in the function parameters. addCommandHandler (server) has 2 main parameters player playerSource, string commandName, [string arg1, string arg2, ...] so it should be: function kivesz (player, command) then you can use player for your functions instead of source or can just change player to source in the function parameters. Thanks
-
addCommandHandler (server) has 2 main parameters player playerSource, string commandName, [string arg1, string arg2, ...] so it should be: function kivesz (player, command) then you can use player for your functions instead of source or can just change player to source in the function parameters. addCommandHandler (server) has 2 main parameters player playerSource, string commandName, [string arg1, string arg2, ...] so it should be: function kivesz (player, command) then you can use player for your functions instead of source or can just change player to source in the function parameters function kivesz(player, command) local accountName = getPlayerAccount(player) if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin" )) then aclGroupRemoveObject(aclGetGroup("Admin"), "user."..accountName) end end addCommandHandler("rangki", kivesz) function betesz(player, command) local accountName = getPlayerAccount(player) if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin1" )) then aclGroupAddObject (aclGetGroup("Admin"), "user."..accountName) end end addCommandHandler("rangbe", betesz)
-
addCommandHandler (server) has 2 main parameters player playerSource, string commandName, [string arg1, string arg2, ...] so it should be: function kivesz (player, command) then you can use player for your functions instead of source or can just change player to source in the function parameters. attempt to concatenate local 'accountName' (a userdata value)
-
--server-- function kivesz() local accountName = getPlayerAccount(source) if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" )) then aclGroupRemoveObject(aclGetGroup("Admin"), "user."..accountName) end end addCommandHandler("rangki", kivesz) function betesz() local accountName = getPlayerAccount(source) if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" )) then aclGroupAddObject (aclGetGroup("Admin1"), "user."..accountName) end end addCommandHandler("rangbe", betesz) and i got this errors and warnings: http://imgur.com/a/tI7mJ how to fix this?