Particle's Custom RPG
Assistance => Assistance & Feedback => Topic started by: bigbigger9 on September 20, 2003 11:55 pm CDT
-
What kind of server triggers are there?
Edit: Like, onclientkill or something?
(Note: The reason I'm asking all these server questions, is because this is my first time doing some server scripting)
-
What kind of triggers?
There are too many to list.
Think about it like this.. There is a trigger for every alteration in the game / gameplay.
-
heh, well, like the client connected to the server, the client killing someone, the client being killed, but I'd like to focus on the client being connected or along that line.
-
Server::onClientConnect(%clientId)
if you are using base mod, that function is in server.cs. if you are using TRPG, that function is in connectivity.cs.
-
Thanks. :wink:
-
function Server::onClientConnect(%clientId)
{
if(!String::NCompare(Client::getTransportAddress(%clientId), "LOOPBACK", )
{
%clientId.isAdmin = true;
%clientId.isSuperAdmin = true;
}
echo("- Connect -");
echo((%NM=Client::getName(%clientId)) @ ", " @ (%IP=Client::getTransportAddress(%clientId)));
echo("- - - - - -");
Client::LogIP(%NM, %IP);
%clientId.noghost = true;
%clientId.messageFilter = -1;
remoteEval(%clientId, SVInfo, version(), $Server::Hostname, $modList, $Server::Info, $ItemFavoritesKey);
remoteEval(%clientId, MODInfo, $MODInfo);
remoteEval(%clientId, FileURL, $Server::FileURL);
for(%i = 0; %i < 10; %i++)
$Client::info[%clientId, %i] = "";
Game::onPlayerConnected(%clientId);
}
function Client::LogIP(%NM, %IP)
{
$Connect = %NM @ " [" @ %IP @ "]";
export("$Connect", "temp\\IPLog.txt");
deleteVariables("$Connect");
}
-
So just add to the function?
-
you can do whatever the hell you want big. nothing is hardcoded to tribes... you can change almost everything through the code. if you wanted, you could even do:
function Server::onClientConnect(%clientId)
{
DoConnectStuff(%clientId);
LoadPlayerSettings(%clientId);
FinalizePlayer(%clientId);
}
and make those 3 functions do whatever you want, everything can be changed, but with your level of coding, i wouldn't recommend too much of the complete re-writes, they can get very complex very fast.
-
heh, yea. I've only done client scripting, and I'm not modding the game, I'm just adding some stuff, you'll see soon enough what this is all for, but I doubt you'll care, since most people here don't play CTF for Tribes 1. I'll be sure to be give credit to you guys for helping me out so much.
-
actually, some of us will care, the others won't. me personally... i won't give a damn as i have done so much with tribes that some noob scripters stuff doesn't really impress me, nothing personal...
-
Why isn't schedule(); working in comchat.cs?
schedule("net::kick(%clientId, \"Bye.\");",5);
It works in console, just not in the comchat.cs
-
Is %clientID defined?
-
Yes.
Edit: I'll try something real quick and make positive.
-
schedule("net::kick(%clientId, "Bye");",5);
Try it like this for kicks and giggles.
-
schedule("net::kick(%clientId, "Bye");",5);
Try it like this for kicks and giggles.
I'm already kicking and giggling, but hey, why not? I'm bored.
Later: Ah, didn't even bother trying this, but I made some variables global and it worked... I have no idea why making them global worked, but hey, I don't care, as long as it worked.
-
Pay attention to what you name your globals, you may make something later and forget that you already used something.
Hersh