Blockland Forums > Modification Help
Checking If A Client Does Not Have A Add On
Greek2me:
Yes, but remove this:
--- Code: ---if(%client.isSpamming())
return;
--- End code ---
It's not a default function.
Also, you'll need to define these at the beginning of your script:
--- Code: ---server: $Summoning::Server::Version, $Summoning::Server::CompatibleVersions
client: $Summoning::Client::Version, $Summoning::Client::CompatibleVersions
--- End code ---
jes00:
--- Quote from: Greek2me on October 30, 2011, 10:44:30 PM ---Yes, but remove this:
--- Code: ---if(%client.isSpamming())
return;
--- End code ---
It's not a default function.
--- End quote ---
Done.
--- Quote from: Greek2me on October 30, 2011, 10:44:30 PM ---Also, you'll need to define these at the beginning of your script:
--- Code: ---server: $Summoning::Server::Version, $Summoning::Server::CompatibleVersions
client: $Summoning::Client::Version, $Summoning::Client::CompatibleVersions
--- End code ---
--- End quote ---
What should I define them as?
Also where is the part that does things if they do not have the add on?
Ipquarx:
Make a clientcmd in the client addon, and then have it check if that clientcmd returns true or something like that when they join, and then it can do something.
Example:
Client:
--- Code: ---function clientCmdHasMyAddon()
{
return true;
}
--- End code ---
Server:
--- Code: ---if(commandToClient(%client, '', "HasMyAddon") == true)
{
dothis();
}
else
{
dothat();
}
--- End code ---
Headcrab Zombie:
--- Quote from: Ipquarx on October 31, 2011, 01:06:01 PM ---snip
--- End quote ---
No, that will not work
--- Quote from: jes00 on October 31, 2011, 06:46:06 AM ---Done.What should I define them as?
--- End quote ---
Number, string, whatever you want. Just make sure that whenever you release a new version of the client, that it matches with the server's versions, and that the versions are listed in the CompatibleVersions variables
--- Quote from: jes00 on October 31, 2011, 06:46:06 AM ---Also where is the part that does things if they do not have the add on?
--- End quote ---
You'll need to add a schedule in ::autoAdminCheck that calls another function, which checks the value of %client.summoning
jes00:
--- Quote from: Headcrab Zombie on October 31, 2011, 02:08:06 PM ---You'll need to add a schedule in ::autoAdminCheck that calls another function, which checks the value of %client.summoning
--- End quote ---
As in this?
--- Code: ---function gameConnection::autoAdminCheck(%client)
{
checkVersion(%client);
return parent::autoAdminCheck(%client);
}
function checkVersion(%client);
{
if(%client.summoning <= VERSION NUMBER)
{
%client.delete("You have version " @ %client.summoning @ " of the Summoning Client, you need a new one.");
}
}
--- End code ---
--- Quote from: Headcrab Zombie on October 31, 2011, 02:08:06 PM ---Number, string, whatever you want. Just make sure that whenever you release a new version of the client, that it matches with the server's versions, and that the versions are listed in the CompatibleVersions variables
--- End quote ---
Ok, I don't completely understand.