-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You put "objects" instead of "object" in some of the tags. Next time you can use this website to look for syntax errors: http://www.w3schools.com/xml/xml_validator.asp
-
getPlayersOnline = function () local playersOnline = getElementsByType ( "player" ) local playersO = 0 for count, playerOn in pairs(playersOnline) do playersO = playersO + 1 end return playersO end That function is completely useless, you can simply use: playersO = #getElementsByType ( "player" ) About the other problem, try this: function Scoreboard() dxDrawImage(X,Y,Width,Height, "images/back.png") dxDrawText("Name", X+60, Y+10, Width,Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText(getPlayersOnline().."/50" ,X+525, Y-15, Width,Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Ping", X+480, Y+10, Width, Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Geld", X+210, Y+10, Width, Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Team", X+350, Y+10, Width, Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) local players = getElementsByType ( "player" ) local playas = 0 local playerheight = 20 for amt, player in pairs(players) do playas = playas + 1 if (playas <= 20) then local ping = getPlayerPing(player) local teamp = getPlayerTeam(player) local teamn = getTeamName(teamp) local money = tonumber ( getElementData(player, "playerMoney") ) or 0 if (ping >= 250) then r,g,b = 255,0,0 elseif (ping >= 120) then r,g,b = 255,69,0 else r,g,b = 0,255,0 end dxDrawText(getPlayerName ( player ), X+60,Y+60+playerheight*(amt-1), Width,Height, tocolor(255,255,255), 1 , "default-bold","left", "top",false, false,true,true) dxDrawText(ping,X+480,Y+60+playerheight*(amt-1), Width, Height, tocolor(r,g,b), 1, "default","left", "top",false,false,true,true) dxDrawText( tostring ( money ) .." $", X+210,Y+60+playerheight*(amt-1),Width, Height, tocolor(255,255,255), 1, "default","left", "top",false, false, true, true) dxDrawText(teamn, X+350,Y+60+playerheight*(amt-1),Width, Height, tocolor(255,255,255), 1, "default","left", "top",false, false, true, true) end end end
-
You haven't posted the full script.
-
You need onClientRender to draw it, where is it?
-
Well, that's just the GUI, you have to make it load the animations from the XML file using the functions I posted earlier.
-
You're welcome.
-
The best way to make interactive DX is to compare the cursor position.
-
Yes, you can add as many groups as you want. To add them you just take one as example, it's exactly the same way.
-
No need to do that? the script I gave you earlier will update the element data when the money changes.
-
What do you mean?
-
Yes, it should work just fine, go ahead a try it.
-
local currentMoney = 0 addEventHandler ( "onClientRender", root, function ( ) local money = getPlayerMoney ( ) if ( currentMoney ~= money ) then outputChatBox ( money ) setElementData ( localPlayer, "playerMoney", money ) currentMoney = money end end ) I'm not sure how efficient this is, it'll set the element data "playerMoney" everytime the player's money changes. Then you can use getElementData to get the player money.
-
Yes, you can use the same one.
-
Use the following functions: xmlLoadFile -- To load the XML files xmlNodeGetChildren -- To get the XML children and a for-loop to loop all the children to add them to the gridlist.
-
No, it would be a lot easier to make your own from scratch.
-
You want the gates to don't open or close if they are already being opened/closed?
-
If you load the map as ".map" then it's not possible, maps don't get saved in the player's HDD.
-
That spawn system and the private vehicle system are made by me, and they are obviously leaked from a server to which I sold them to. Topic locked.
-
Post the client side script.
-
'vehicle' is not defined anywhere.
-
La unica manera de hacer esto es hacer al vehiculo indestructible ( damage proof ).
-
Your answer has nothing to do with what he's asking. @Jacobob: I guess that you'll have to edit the script to edit how it works.
-
El script es server side o client side? si es client side te recomiendo usar onClientRender o onClientPreRender.
