ID:1439019
 
I have a code that checks for people who are multi-keying from the same IP. I want it so I know if they are on the same Computer, like if they have same computer ID or osmething

Heres the multi-key code, maybe you can do something with it.
Mob/Owner
verb
Multi_Key_Check()
set category = "Staff"
set desc = "Check all Player for Multi-Keying"
var/Found[0]
for(var/mob/M in world)
if(Found.Find(M))continue
if(M.client)
for(var/mob/M2 in world)
if(!M2.client)continue
if(!M2)continue
if(M == M2)continue
if(M.client.address == M2.client.address)
Found += M
Found += M2
usr << "<B>\red Match Found!"
usr << "<B><font color = #999999>Name:</font> [M.name] <B><font color = #999999>- Key:</font> [M.key] <B><font color = #999999>- Address:</font> [M.client.address]."
usr << "<B><font color = #999999>Name:</font> [M2.name] <B><font color = #999999>- Key:</font> [M2.key] <B><font color = #999999>- Address:</font> [M2.client.address]."

You'll want to use client.computer_id.

Example:
client/verb/check(mob/M as mob)
if(M.client.computer_id == src.computer_id)
src << "These two clients are on the same computer."
ok ty ill try it out
Sorry for the late response, I haven't been on BYOND for a few days. It says src. undefined var.
In response to Naruto 5292
computer_id is a client variable. If you're trying to access it from a procedure that isn't defined on /cli0ent, you'll need to access if from the mob's client variable.

For example, in your above loop, you could say if(M.client.computer_id == M2.client.computer_id) to check for two mobs having the same client.
Ya that is what i was trying to do but it says M2 undefined var.
Make sure you're doing it within the for(M2) loop
hmm a bit confused can u show me? or explain a bit more? ty
In response to Naruto 5292
Naruto 5292 wrote:
hmm a bit confused can u show me? or explain a bit more? ty

for(var/mob/M2 in world) // <- THERE
if((M == M2) || (!M2.client) || (!M2))continue
if(M.client.computer_id == M2.client.computer_id)
// Rest of code goes here
thank you very much!