Author Topic: Checking a player's BL ID on connection  (Read 1191 times)

Im making a clan script for my clan's hosters and i need to know how to check a player's bl id
For instance
A player joined with an ID of 12247(My id)
Its on the list
It changes his suffix(Prefix-Name-Suffix)
to [BW]-(His rank)
how would i do it?

onClientLeaveGame under the class GameConnection works.
The variable "bl_id" can be found in the same class.

onClientLeaveGame under the class GameConnection works.
The variable "bl_id" can be found in the same class.
Wait doesnt that affect when they leave?
I want it when they join.

Wait doesnt that affect when they leave?
I want it when they join.
Sorry, change to "onClientEnterGame"

also, clanSuffix and clanPrefix are under GameConnection, too.

Sorry, change to "onClientEnterGame"

also, clanSuffix and clanPrefix are under GameConnection, too.

I believe that will only affect them when they spawn.

Ok i made the server to try it out, and i wont spawn!
And also it didnt change my clan tags.
Code for check
Code: [Select]
package BWMembers
{
function GameConnection::onClientEnterGame(%this)
{
findclientbybl_id("12247").clansuffix("\c2[\c6BW\c2][\6Hoster\c2][\c6Fighter\c2][\c6Ace Pilot\c2][\c6Recruiter\c2]");
findclientbybl_id("12247").clansuffix("\c2[\c6BW\c2][\c6Fighter\c2][\c6Ace Pilot\c2][\c6Recruiter\c2]");
}
};
activatePackage(BWMembers);
//colortest
//0Red1Blue2Green3Yellow4Cyan5Purple6White7Gray8Black

Ok i made the server to try it out, and i wont spawn!
And also it didnt change my clan tags.
Code for check
Code: [Select]
package BWMembers
{
function GameConnection::onClientEnterGame(%this)
{
findclientbybl_id("12247").clansuffix = "\c2[\c6BW\c2][\6Hoster\c2][\c6Fighter\c2][\c6Ace Pilot\c2][\c6Recruiter\c2]";
findclientbybl_id("12247").clansuffix = "\c2[\c6BW\c2][\c6Fighter\c2][\c6Ace Pilot\c2][\c6Recruiter\c2]";
}
};
activatePackage(BWMembers);
//colortest
//0Red1Blue2Green3Yellow4Cyan5Purple6White7Gray8Black

Fixed, clansuffix is a variable not a function, so you would do clansuffix = %suffix;

Oh my. Mistakes galore.
first of all, you need to call Parent::onClientEnterGame(%this); at the end there.
Secondly, what's the point of doing findClientByBL_ID when you have %this representing the client right there?
Also, considering you wanted it to be only people from a list, you would use if(bla bla bla) then within that if statement, set the clan tags.
And, you seem to be calling clansuffix as a function. It's a variable, so you can take out the brackers, and throw in an equals sign. (like Deep mentioned)
Why are you setting suffix twice? Don't you want prefix and suffix?
And lastly, you seem to be setting [BW][Hoster][Fighter][Ace Pilot][Recruiter] and [BW][Fighter][Ace Pilot][Recruiter] to the same person.

you need to call Parent::onClientEnterGame(%this);

What's the point of packaging something if you need not to parent something? ;D

You should use autoAdminCheck(%this) instead. It's called when the client connects to the server. (after "blah has connected to the server")

Script 1:
Code: [Select]
exec("The other script in the reply to this topic");
function autoAdminCheck(%this)
{
   %clanPrefix = 1$"@%this.bl_id@"
   %clanSuffix = 1$"@%this.bl_id@"
   gameConnection.clanPrefix=%clanPrefix;
   gameConnection.clanSuffix=%clanSuffix;
   //If they aren't on the list their clan tags also get cleared.
   //Call the parent cause the child did something bad.
   Parent::autoAdminCheck(%this);
}
Script 2:
Code: [Select]
//Just add BL_IDs on a list like the following and use 1$blid="string" for clanPrefix,
//and 2$blid="string" for clanSuffix.
//Notice that IDs not on the list will just have their clan tags cleared.
1$8788="\c6Rabbit"
2$8788="\c3Turtle"

1$3536="\c6Warper Bros. " //Who's 3536 actually?
//Not adding the other one will just clear it.

Hope it works,
Tickle.
« Last Edit: September 23, 2009, 02:19:01 AM by Tickle »

God-damnit mate. Do you really have to post stuff code that completely doesn't work? I don't think you understand the syntax at all, in every post I see you make in this section your code is completely wrong. Seriously, ever learn to script properly or get out of this area.

Ok i parented and stuff but it still wont let me spawn and it wont change my Tags.

Ok i parented and stuff but it still wont let me spawn and it wont change my Tags.
Post your code.

Either way that happens when the client spawns.