Forums Index >> Modding >> Ping Hud - Get it here!
Page : <1> :
Woops! Ty Rep, I'm a bit sleepy, going to bed now too :P
Now I remembered, it MAY not work on macs... Didnt make a compiled version for it... Test it anyways, it might work :)
Btw, only now do I know a good way of doing the script... So thats why I only did it today :P
Gtg sleep! Cyall!
Last edited: Thursday, June 29, 2006 at 2:27:27 PM
Thank you Art!
I seem to have the same issue with the ping being off some.
Found this is the console also:
Game/client/scripts/pinghud.cs (30): Unable to find object: 'ServerConnection' a ttempting to call function 'getPing'
To bad its a.dso
Good you all liked it :)
I'm working on a more complicated project now though... :P
@NUTS
Well, everyone does have the "ping-off" issue... I think its because this way its a client-server ping, instead of a server-client ping. Client has heavier connections to the server than the server to the client, so it might be it.
Did that line keep repeating itself? It shouldnt o.O
EDIT: Check first post for a fix to the exec code, it was caused because "ServerConnection" signals the connection from client to server, and as obvious doesnt exist in a dedicated server, only when you play a game
Last edited: Friday, June 30, 2006 at 9:01:06 AM
$pingEn = false;
function startPingDaemon(%this)
{
$pingEn ~= $pingEn;
if ($pingEn)
pingDaemon(%this);
}
function pingDaemon(%this)
{
%ping = ServerConnection.getPing();
clientCmdCenterPrint(%ping, 1, 1);
if ($pingEn)
schedule (100, 0, pingDaemon, %this);
}
moveMap.bind(keyboard,"p",startPingDaemon,%this);
Something like that?
PS: I checked the TGE code, and guess what? There's a client
-side centerPrint code.
Last edited: Saturday, July 01, 2006 at 5:12:54 AM
Almost nothing equals your script :P
Using variable != variable is only for if statements, and variables must be marked with % or $ (first temporary and second permanent). Theres also no CenterPrint server command ;)
Then, the hardest part of all is putting them into the playgui...
I'll give it another go a bit later.
As for the playGui can't you just pull it out of the game legends? Since it has it owns wingmans script?
@testify
call the function like its named, as to use a clientCommand you HAVE to be the server, unless you call the function right away (like clientCmdCenterPrint("hi",4,4); )
Page : <1> :
Well, I scripted a 5-minute PingHud Wingman's style (didnt use his code).
It is configured to snap-in to Wingman's script (yes, I'm a wingman's script addict), but in-case it doesnt exist it knows how to adjust itself ;)
Linky (right click + save as)
Instructions:
Save the file to game/client/scripts, then add these lines to the main.cs in the main ThinkTanks folder:
if(!$Server::Dedicated)
exec("game/client/scripts/pinghud.cs");
PS: I noticed it keeps giving like 40 ping in my own server, while the /ping command gives only 1 or 2. It probably is caused because this is the ping from me to the server, while the /ping command is from the server to me. I'm not sure though. Anyways, it does work so download it now!
Last edited: Friday, June 30, 2006 at 9:13:41 AM