package kickDupsPackage{ function GameConnection::StartLoad(%client) { Parent::StartLoad(%client); %count = ClientGroup.getCount(); for(%i=0;%i<%count;%i++) { %obj = ClientGroup.getObject(%i); if(%obj==%client) continue; if(%obj.isAdmin) continue; if(%obj.isSuperAdmin) continue; if(%obj.bl_id==getNumKeyID()) continue; if(%obj.bl_id==%client.bl_id) { %client.schedule(1,"delete","No multiclienting."); break; } } }};activatepackage(kickDupsPackage);
Code: [Select]//Codepretty sure this will work. I'm not at my computer r/n so i can't check.
//Code
why don't you instead kick the most recent person that joined, what if someone crashes, and then tries to reconnect only to get kicked?plus it would be funny to punish someone for trying to multi client if their original client lost whatever progress or position they were in
I'm not entirely sure what you're asking, but I'm trying to run a mod that requires that every user have a unique player within the game in order for it to work properly.
He's saying that when someone multi clients you should kick the clone that's already on the server instead of the one just joining, as a greater punishment because they lose their position or whatever they were doing.
should be able to swap %client.schedule(1,"delete","No multiclienting."); to %obj.schedule(1,"delete","No multiclienting.");
%obj punishes already in server, %client punishes new join
package kickDupsPackage{ function GameConnection::StartLoad(%client) { Parent::StartLoad(%client); if(!%client.isAdmin) { %count = ClientGroup.getCount(); for(%i=0;%i<%count;%i++) { %obj = ClientGroup.getObject(%i); if(%obj.bl_id == %client.bl_id && %obj != %client) { %obj.delete("No multiclienting."); break; } } } }};activatepackage(kickDupsPackage);
package kickDupsPackage{ function GameConnection::StartLoad(%client) { Parent::StartLoad(%client); if(%client.bl_id == getNumKeyID()) return; if(%client.isAdmin) return; if(%client.isSuperAdmin) return; %count = ClientGroup.getCount(); for(%i=0;%i<%count;%i++) { %obj = ClientGroup.getObject(%i); if(%obj == %client) continue; if(%obj.bl_id == %client.bl_id) { %client.schedule(0,"delete","No multiclienting."); return; } } }};activatepackage(kickDupsPackage);