Help with a simple Script for Server

1
I have a question.
Will this announce when a player leaves the server?

function my_callback(%client) {
centerprintall("Character ID " @ %client.player.getCharacterId() @ " has left the world!", 8);
}
TTmod_registerPlayerLeaveCallback("my_callback");


And if its correct can I save it and the script to announce when a player joins to the same file and have it still work properly?

I know nothingnothingnothing about scripts.

Thanks

Re: Help with a simple Script for Server

3
Okay
As Im am unsure if Ive done this correctly Im putting it here for you to see. Also Ive noticed there is a folder in the main folder the is called lif_scripts. Is this were I should/can house custom scripts? Lastly as far as naming the script goes. I would just save it as activity.cs and then point to it in the main.cs file?

function player_logout(%client) {
centerprintall("Character ID " @ %client.player.getCharacterId() @ " has left the world!", 8);
}
TTmod_registerPlayerLeaveCallback("player_logout");

Thank You
Cia

Re: Help with a simple Script for Server

5
I continue in this thread since it seems the most appropriate to follow my question ...

I'm not very knowledgeable about this programming language, that's why I need a little help,

I put the script on my next server ...

Code: Select all

function my_callback (% client) {
     centerprintall ("Character ID" @% client.player.getCharacterId () @ "you entered the world!", 8);
}
TTmod_registerPlayerEnterCallback ("my_callback");
Effectively works perfect, my question is how I would have to put it, so that this message would appear in the tabs of System and at the same time in Local ?.
I did tests but the truth is, I think I'm quite clumsy.

Thank you.
cron