Author Topic: Server IDs Code Help  (Read 3149 times)

Code: [Select]
package IDS
{
function GameConnection::LoadMission(%c,%a,%b,%d,%e,%f)
{
if(%client.bl_id == 9088)
{
Messageall(' ',"Player ID: 0 has joined the server!" SPC %say);
}
Parent::LoadMission(%c,%a,%b,%d,%e,%f);
}
};
activatepackage(IDS);

I tried this but it didn't work... can someone help?

Wait i tried to fix it and it still doesnt work

 
Code: [Select]
package IDS

{
function GameConnection::LoadMission(%a,%b,%c,%d,%e,%f)
{
if(%client.bl_id == 9088)
{
ChatMessageall(' ',"Player ID: 0  has joined the server!" %say);
}
Parent::LoadMission(%a,%b,%c,%d,%e,%f);
}
};
activatepackage(IDS);

your referencing %client - but its not being defined anywhere, or set to anything.  so %client.bl_id is "" (an empty string)

try this:
Code: [Select]
package IDS

{
function GameConnection::LoadMission(%a,%b,%client,%d,%e,%f)
{
if(%client.bl_id == 9088)
{
ChatMessageall(' ',"Player ID: 0  has joined the server!");
}
Parent::LoadMission(%a,%b,%c,%d,%e,%f);
}
};
activatepackage(IDS);

GameConnection::autoAdminCheck(%this)

Try using that function instead.

GameConnection::autoAdminCheck(%this)

Try using that function instead.
What do you mean %this?

Code: [Select]
package IDS

{
function GameConnection::autoAdminCheck(%this)
{
if(%client.bl_id == 9088)
{
ChatMessageall(' ',"Player ID: 0  has joined the server!");
}
Parent::autoAdminCheck(%this);
}
};
activatepackage(IDS);
« Last Edit: May 10, 2010, 04:00:26 PM by Bot »

Ok i tried something else...

Code: [Select]
package IDS
{
function GameConnection::autoAdminCheck(%client)
{
Parent::autoAdminCheck(%client);
%client.oldPrefix = %client.clanPrefix;

if(%client.bl_id $= 9088())
{
%client.clanPrefix = "\c6[\c20\c6]\c7" SPC %client.oldPrefix;
}


};
activatepackage(IDS);

Code: [Select]
package IDS
{
function gameConnection::autoAdminCheck(%this)
{
messageAll('',"\c7Player ID: "@%this.bl_id@" has joined the server!");
return parent::autoAdminCheck(%this);
}
};
activatepackage(IDS);
Changed it and stuff.
« Last Edit: May 10, 2010, 06:49:15 PM by HellsHero »

In autoAdminCheck you need to return the parent or you'll break the auto-admin feature.

In autoAdminCheck you need to return the parent or you'll break the auto-admin feature.
Oh yeah, forgot. Fixed it anyways.

wtf is %this? is it suppose to actually be %this.

I tested it and thats not what i wanted it to be... i wanted it to have a SERVER id not a BL_ID.

like if client bl_id joined the server it would say Player ID: 0 joined the server. and so on...

I tested it and thats not what i wanted it to be... i wanted it to have a SERVER id not a BL_ID.

like if client bl_id joined the server it would say Player ID: 0 joined the server. and so on...
Wait what, do you mean the first person to join is 0 and the second is 1 and so on?

Wait what, do you mean the first person to join is 0 and the second is 1 and so on?
Yes, like if i join my ID now is 0 and if someone else comes there id is 1 but if they leave and another person comes there id is 2 not 1. like it saves there id.

I tested it and thats not what i wanted it to be... i wanted it to have a SERVER id not a BL_ID.

like if client bl_id joined the server it would say Player ID: 0 joined the server. and so on...
function getPlayerID(%client)
{
    for(%a = 0; %a < ClientGroup.getCount(); %a++)
   if(ClientGroup.getObject(%a) == %client)
       return %a;
}

Yes, like if i join my ID now is 0 and if someone else comes there id is 1 but if they leave and another person comes there id is 2 not 1. like it saves there id.
BL_ID? :V