It works fine on connect, but I can't get it to trigger disconnect.
Is the level notified on player disconnect?
Or what?
I'm so confused

Moderator: Core Staff
Code: Select all
for (;;) {
level/self waittill("<what do I put here?> ");
// code
//...
}
Code: Select all
onPlayerConnect()
{
for(;;)
{
level waittill("connecting", player);
player._guid = player getGuid();
player thread onPlayerDisconnect();
}
}
onPlayerDisconnect()
{
self waittill("disconnect");
iprintln(self._guid);
}
Code: Select all
/*================
Called when a player drops from the server.
Will not be called between levels.
self is the player that is disconnecting.
================*/
CodeCallback_PlayerDisconnect()
{
    self notify("disconnect");
    [[level.callbackPlayerDisconnect]]();
}
Code: Select all
level notify("disconnecting", self);
Code: Select all
player codjumper\_cj_admins::promotePlayer(1);
How exactly do you use this function? This would be great for what i'm needing =Pmegazor wrote:Play around with maps\mp\gametypes\_callbacksetup.gsc
This is the part you will want to deal with:
you can add hereCode: Select all
/*================ Called when a player drops from the server. Will not be called between levels. self is the player that is disconnecting. ================*/ CodeCallback_PlayerDisconnect() { Â Â Â Â self notify("disconnect"); Â Â Â Â [[level.callbackPlayerDisconnect]](); }
or another function. But I suggest to avoid modifying the stock file, better use the [[level.callbackPlayerDisconnect]]() function, which is defined in gametype script files.Code: Select all
level notify("disconnecting", self);
Users browsing this forum: No registered users and 2 guests