-
Posts
1,803 -
Joined
-
Last visited
-
Days Won
8
Everything posted by Citizen
-
You have to use getAccountName: function Add (playerNick, level) local LevelToGive = getAccountName( getPlayerAccount( getPlayerFromName( playerNick )))
-
Yes because this function returns the player's account object, or false if the player passed to the function is invalid. Then you can for example: setAccountData ( LevelToGive ,... What you want to do with the account ?
-
Hi, In the getPlayerAccount, your are to specify the Player element so you have to getPlayerFromName( playerNick ) like this: function Add (playerNick, level) local LevelToGive = getPlayerAccount( getPlayerFromName( playerNick )) It should work now
-
I know but I have no idea so .... ^^
-
lol sorry, I undestood that you want only the ping . My bad
-
That's strange, the toptimes_server.lua is in your meta.xml at line 8: <script src="toptimes_server.lua" type="server"/> Maybe put it in first place ?? Otherwise I don't know maybe Solidsnake or another scripter can help you on this error
-
---------------------------------- Double Post: ---------------------------------- For the column ping in your scoreboard try this: add this with the others exports.scoreboard:scoreboardAddColumn: exports.scoreboard:scoreboardAddColumn( "PING" ) and put it anywhere: function refreshPing() local ping = getPlayerPing( getLocalPlayer() ) setElementData( getLocalPlayer(), "PING", ping ) end setTimer( refreshPing, 2000, 0 ) and It might works
-
Yeah I understoud it The dxScoreboard make a getElementData each seconds ( maybe or 2 sec IDK ) so you just have to specify to your scoreboard the ElementData by this line: exports.scoreboard:scoreboardAddColumn( "theElementData" ) When the dxScoreboard knows the ElementData to get, you can: setElementData( thePlayer, "ElementData", theValue ) when and wherever you want and the scoreboard update the column automatically. That's right ? ( Maybe I'm wrong ? ) EDIT: I checked the dxscoreboard and I'm right
-
You have to create an element data like this: (Use the code of Solidsnake and add your element data:) addEventHandler ( "onClientResourceStart", getRootElement(), function (resource) if resource == getThisResource() then exports.scoreboard:scoreboardAddColumn ( "FPS" ) exports.scoreboard:scoreboardAddColumn ( "State" ) setElementData ( getLocalPlayer ( ), "FPS", 0 ) setElementData( getLocalPlayer ( ), "State", "Waiting" ) end end ) Add change his state whenever you want like this: setElementData( thePlayer, "State", "Alive" ) set it to "Alive" or "Waiting" or "Dead" Exemple: function onPlayerDead( ammo, attacker, weapon, bodypart ) setElementData( source, "State", "Dead" ) end addEventHandler( "onClientPlayerWasted", getRootElement(), onPlayerDead )
-
What ? That's very strange ! Because all events are added ! Are you sure that your code is loaded ? ( maybe in the meta.xml ?)
-
Hi volk-us ( again ), Replace by this: local anomalstp1 = { {286.05, 1319.48, 3}, } function onAnomalyHit( hitElement, matchingDimension ) --instructions end function anomalys( thePlayer, matchingDimension ) local fX = anomalstp1[1] local fY = anomalstp1[2] local radius = anomalstp1[3] local colcircle = createColCircle ( fX, fY, radius ) addEventHandler ( "onColShapeHit", colcircle, onAnomalyHit ) outputChatBox("1") end addEventHandler ( "onResourceStart", getRootElement(), anomalys ) It should works
-
No problem
-
lol here a ) is missing to close the addEvent at line 405
-
I see your post bamby12 but IDK sry maybe another scripter can help you
-
There is an extra ) in your line 36. If you are not sure show us your line 36
-
Hi The Kid, Check that: next
-
Hi The Kid, lol I thought that at the begining but I have another idea: (All in ServerSide: ) Replace all givePlayerMoney by giveMoney in your GM and put this function in your code: function giveMoney( thePlayer, money ) if amount and money then givePlayerMoney( thePlayer, money ) triggerEvent( "onPlayerMoneyChange", getRootElement (), thePlayer, money ) end end And put this at the top of your GM: addEvent("onPlayerMoneyChange", true ) Then you can use addEventHandler( "onPlayerMoneyChange", getRootElement(), yourFunction ) for every functions you want Exemple: function yourFunction( thePlayer, money ) -- executed each time the server uses the giveMoney function end addEventHandler( "onPlayerMoneyChange", getRootElement(), yourFunction ) I think that it is what you want
-
So make it ! and if it works, you can take some exemple from the wiki, put in your code, test it IG and try to modify it. (It's the better way to learn by yourself !).
-
Seanny you don't see my post ? make this for starting: viewtopic.php?f=91&t=32029&start=15#p339529
-
And there are no errors in clientscript.log ? No outputChatBox ? Try to put another outputChatBox here: function createZombieClass( player ) outputChatBox( "createZombieClass" )
-
Hi DeadTeamRacing, Before replace this: outputChatBox("#0000ff*#ffffff"..getPlayerName(source).. ' Has got a new Toptime #ff000 Rank: ' .. newPos .. " #ff6600 | Time:"..msToTimeStr(newTime)) by this: outputChatBox("#0000ff*#ffffff"..getPlayerName(source).." Has got a new Toptime #ff000 Rank: " .. newPos .. " #ff6600 | Time:"..msToTimeStr(newTime)) Except that, it might works but I unknow this function ( msToTimeStr ) so I can't say if it's works: But why you can't try it yourself ?
-
Ok and I found an error in this setTimer; setTimer (createZombieClass( v ),20000,1) ( It's correct ? ) replace by: setTimer (createZombieClass,20000,1,v) It might be the last error
-
Surely it's not the reason but why you put some ";" ? Here: setTimer (createZombieClass( v ),20000,1); end; spawnPlayer( source, x, y, z, rot); setCameraTarget (source, source ); fadeCamera( source, true );
-
Lol I did not know that this problem made this error. See that viewtopic.php?f=91&t=32073 And I found the problem of spaces but I never seen this error EDIT: lol In fact, it's the same error but with an extra at the end
-
Thanks No problem