Blockland Forums > Modification Help
Checking If A Client Does Not Have A Add On
jes00:
How do you check if a client does not have an add on and do things if they do not have it?
FFSO:
This would be the code your looking for...although I believe it requires something else otherwise it would cause Authentication Errors when trying to host.
--- Code: --- function GameConnection::onConnectRequest(%this,%a,%b,%c,%d,%e,%f,%g,%h,%i)
{
echo("\n" @ %c SPC "trying to connect.");
if(%f !$= "")
{
%this.hasRTB = 1;
%this.rtbVersion = %f;
}
if(getField(%h,1) $= "DRPG")
{
echo(%c SPC "trying to connect with DRPG v" @ getField(%h,2) @ ".");
if(trim(getField(%h,2)) >= trim($DRPG::ClientVersion))
{
%this.hasDRPG = 1;
%this.drpgVersion = getField(%h,2);
Parent::onConnectRequest(%this,%a,%b,%c,%d,%e,%f,%g,%h,%i);
}
else
{
echo(%C SPC "needs to download a new version of DRPG.");
%this.schedule(0,"delete","You need the latest <a:brianhosting.net/BLAD/uploads/Client_DRPG.zip>DRPG Client</a> (v" @ $DRPG::ClientVersion @ " ) to play on this server.");
return;
}
}
else
{
echo(%c SPC "trying to connect without DRPG.");
%this.schedule(0,"delete","You need the latest <a:brianhosting.net/BLAD/uploads/Client_DRPG.zip>DRPG Client</a> (v" @ $DRPG::ClientVersion @ " ) to play on this server.");
}
}
--- End code ---
M:
And every single different add-on that uses this method breaks every other one. And RTB, half the time.
Amade:
use gameconnection::autoadmincheck instead
Nexus:
--- Quote from: Amade on October 28, 2011, 06:21:09 PM ---use gameconnection::autoadmincheck instead
--- End quote ---
But the client sends no information during that.