I actually want to kick fakeplayers (bots) from my server, so I took a look at this thread [ https://killtube.org/showthread.php?...ke-clients-fix ]
Now, whenever I try to put the script in sd.gsc, I got bad syntax, pls help me!!
PHP Code:
notifyConnecting()
{
self endon("disconnect");
waittillframeend;
if(isDefined(self))
{
level notify("connecting",self);
setQ3Fix(); //Add this line
}
}
setQ3Fix()
{
if(!isDefined(level.q3_fix))
level.q3_fix = [];
my_ip = getIP(self);
if(isDefined(level.q3_fix[my_ip]) && !self.data["bot"])
{
self setClientCvar("com_errorTitle", "Error"); //Maybe somehow system will fail (it should'nt but we should always assume that can happens) and a real client can be kicked.
self setClientCvar("com_errorMessage", "IP duplicate detected"); //So let him know, what went wrong.
self.kicked = true;
println("Warning: Kicking client with IP duplicate: "+my_ip);
kick(self getEntityNumber());
return true;
}
if(!self.data["bot"])
level.q3_fix[my_ip] = true;
return false;
}
getIP(client)
{
return closer(430, client getEntityNumber());
}
println(msg)
{
closer(200, msg + "\n");
}
Callback_PlayerDisconnect()
{
if(!isDefined(self.kicked))
level.q3_fix[getIP(self)] = undefined;
[...]
}