-
Posts
231 -
Joined
-
Last visited
Everything posted by boro
-
myonlake, scoreboard now not open when i press tab local partOfName = string.sub( playerName, firstCodePos, secondCodePos ) local textLength = dxGetTextWidth( partOfName, fontscale(contentFont, s(1)), contentFont ) dxDrawText( partOfName, xPos+s(1), y+s(1), topX+x+s(1+column.width), y+s(11) +dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( 0, 0, 0, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) dxDrawText( partOfName, xPos, y, topX+x+s(column.width), y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale (contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) xPos = xPos + textLength end elseif column.name == "Rank" then if getElementData(localPlayer, "Rank") then dxDrawImage(topX+theX, y+s(1), 16, 11, getElementData(localPlayer, "Rank"), 0, 0, 0, cWhite, drawOverGUI) end end else dxDrawText( content, topX+theX+s(1), y+s(1), topX+x+s(1+column.width), y+s(11) +dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( 0, 0, 0, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) dxDrawText( content, topX+theX, y, topX+x+s(column.width), y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale (contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) end end x = x + s(column.width + 10) end end local font = iif( element and isElement( element ) and getElementType( element ) == "team", teamHeaderFont, contentFont ) y = y + dxGetFontHeight( fontscale(font, scoreboardScale), font ) index = index + 1 end index = 1 end end end
-
Hi all i make rank score but it doesn't work, check it , and please help me. TY rank server function scoreLevel () local account = getPlayerAccount(source) local level = getAccountData(account, "rank") local nameimage = "level" if rank== false then setElementData(source, "Rank", "level0.png") end end addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) scoreboard client elseif column.name == "Rank" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI )
-
IS it good type="script" version="1.0" name="Police Station" author="boro"/> laddEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), function() txd = engineLoadTXD("policeST.txd", 1456 ) engineImportTXD(txd, 1456) end )
-
do you think this? function login() local serial=getPlayerSerial ( source ) local userAccount = getAccount(serial) local pass = "password" probeer = logIn(source,userAccount,pass) if (probeer) then fadeCamera(source,true) setCameraTarget(source, source) return false else local serial= getPlayerSerial ( source ) local pass = "password" addAccount(serial,pass) local userAccount = getAccount(serial) local doen if (source and userAccount ~= false and userAccount ~= nil) then doen = logIn(source,userAccount,pass) if (doen) then fadeCamera(source,true) setCameraTarget(source, source) end end end end addEventHandler("onPlayerJoin", getRootElement(),login)
-
Plese help me, what is the problem ? login/login.lua:6: Bad argument @ 'logIn' [Expected account at argument 2, got boolean] function login() local serial=getPlayerSerial ( source ) local userAccount = getAccount(serial) local pass = "password" probeer = logIn(source,userAccount,pass) if (probeer) then fadeCamera(source,true) setCameraTarget(source, source) else local serial= getPlayerSerial ( source ) local pass = "password" addAccount(serial,pass) local userAccount = getAccount(serial) local doen if (source and userAccount ~= false and userAccount ~= nil) then doen = logIn(source,userAccount,pass) if (doen) then fadeCamera(source,true) setCameraTarget(source, source) end end end end addEventHandler("onPlayerJoin", getRootElement(),login)
-
Hi all, please help with this for i,player in ipairs(getElementsByType("player")) do local model = getElementData(getPlayerTeam(player),"Skins")[1] setElementModel(player,model) Bad argument @ 'getElementData' [Expected element at argument 1, got boolean] attempt to index a boolean value
-
yes now without warning but still don't work kills and deaths, isn't saved
-
Please help what is bad ? [2012-12-19 12:17:15] WARNING: killsave/server.lua:4: Bad argument @ 'isGuestAccount' [Expected account at argument 1, got nil] [2012-12-19 12:17:15] WARNING: killsave/server.lua:5: Bad argument @ 'getAccountData' [Expected account at argument 1, got nil] [2012-12-19 12:17:15] WARNING: killsave/server.lua:6: Bad argument @ 'getAccountData' [Expected account at argument 1, got nil] node = xmlLoadFile ("player.xml") function playerLogin (_, theCurrentAccount, autoLogin) if not (isGuestAccount (theCurrentAccount)) then -- no need to get the players account local accountData = getAccountData (theCurrentAccount, "Deaths") local accountData = getAccountData (theCurrentAccount, "Kills") if (accountData) then setElementData(source,"Deaths",accountData ) --use the account data var instead of getting another var plus use setElementData setElementData(source,"Kills",accountData ) --use the account data var instead of getting another var plus use setElementData end end end addEventHandler("onPlayerLogin", getRootElement(), playerLogin) function onQuit() local account = getPlayerAccount (source) --get there account here first if not (isGuestAccount (account)) then setAccountData(account,"Deaths",getElementData(source,"Deaths")) --use getElementData setAccountData(account,"Kills",getElementData(source,"Kills")) --use getElementData end end addEventHandler("onPlayerQuit", getRootElement(), onQuit)
-
yes function playSounds ( file,vol ) local sound = playSound( file ) --Play file from the resource folder setSoundVolume(sound, vol) -- set the sound volume to 100% end addEvent( "onPlaySound", true ) addEventHandler( "onPlaySound", getRootElement(), playSounds )
-
try this local amountOfTopsToDisplay = 3 -- how many tops you need addCommandHandler("top", function(player, command, value) local fileindex = xmlLoadFile("users.xml") -- load file local file = xmlNodeGetChildren(fileindex) if file then -- if file exists if value == "wins" or value == "points" or value == "second" or value == "third" then -- if syntax is right local tableOrder = {} -- make a table local subTable = {} -- make a sub table for i,v in ipairs(xmlNodeGetChildren(fileindex)) do -- get children from file subTable.name = xmlNodeGetAttribute(v, "nick") -- name goes in subTable subTable.data = xmlNodeGetAttribute(v, value) -- data goes in subTable table.insert(tableOrder, subTable) -- subTable is inserted in bigger table subTable = {} -- empty subTable for next loop end table.sort(tableOrder, function(a,b) return tonumber(a.data) > tonumber(b.data) end) -- put data in order outputChatBox("Displaying top "..value, player, 255,255,255,true) for i,v in ipairs(tableOrder) do -- loop the sorted table outputChatBox(i..": "..v.name.." - "..a,b.data, player, 255,255,255,true) -- display in order if i == amountOfTopsToDisplay then break end -- when enough tops has been shown, break it end else outputChatBox("Syntax : /top [wins|points|second|third]", player, 255,255,255,true) -- show the correct syntax if he got it wrong end xmlUnloadFile(fileindex) -- unload the file from memory end end )
-
yes i fix it , this help me
-
I tried but 2012-11-30 17:57:22] Starting mapmanager [2012-11-30 17:57:22] Start up of resource mapmanager cancelled by script [2012-11-30 17:57:22] Stopping mapmanager [2012-11-30 17:57:22] start: Failed to start resource 'mapmanager' [2012-11-30 17:57:23] Starting mapmanager [2012-11-30 17:57:23] Start up of resource mapmanager cancelled by script [2012-11-30 17:57:23] Stopping mapmanager [2012-11-30 17:57:23] start: Failed to start resource 'mapmanager'