Giving players points

Questions, comments, and news on the server side plug-ins and it's API
Post Reply
User avatar
the panda next door
Private First Class
Private First Class
Posts: 42
Joined: Sun Mar 16, 2008 3:55 am
Location: Las Vegas

Giving players points

Post by the panda next door »

How do I give players points and get the size of a team?
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

you can not change players scores in 2.0.x. The client tracks the score and it can not be changed by the server.

in 3.0 you can use these functions

Code: Select all

BZF_API bool bz_setPlayerWins (int playerId, int wins);
BZF_API bool bz_setPlayerLosses (int playerId, int losses);
BZF_API bool bz_setPlayerTKs (int playerId, int tks);
To get the current team size, you can call

Code: Select all

BZF_API int bz_getTeamCount (bz_eTeamType team );
in 2.0.x and 3.0
ImageJeffM
User avatar
the panda next door
Private First Class
Private First Class
Posts: 42
Joined: Sun Mar 16, 2008 3:55 am
Location: Las Vegas

Post by the panda next door »

How can I make a player get points for capping a flag.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

you can NOT set the score of an individual player in 2.0.x for any reason, capture, death, anything. It is NOT something that is supported by the game protocol.

You can set the team scores by using;

Code: Select all

BZF_API void bz_setTeamWins (bz_eTeamType team, int wins );
BZF_API void bz_setTeamLosses (bz_eTeamType team, int losses );
ImageJeffM
User avatar
the panda next door
Private First Class
Private First Class
Posts: 42
Joined: Sun Mar 16, 2008 3:55 am
Location: Las Vegas

Post by the panda next door »

Where do I get 3.x?
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

3.0 is under development as 2.99.x It is the current TRUNK in SVN, and can only be gotten from there. you can see http://my.bzflag.org/w/SVN for info on how to use subversion.

It is totally incompatible on both the server and client from any 2.0.x version and is unstable development code.
Last edited by JeffM on Wed Jun 18, 2008 3:51 pm, edited 1 time in total.
ImageJeffM
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Post by joevano »

On an aside, there can/will be problems with giving points to the individual who captures a flag. It will result in TKing just before someone caps so that they (the TKer) can have a chance to cap and collect the points. Capturing the flag is a team event, because most caps cannot happen without help from your team.
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
User avatar
the panda next door
Private First Class
Private First Class
Posts: 42
Joined: Sun Mar 16, 2008 3:55 am
Location: Las Vegas

Post by the panda next door »

Would it be good to give points to the whole team?

Also, insead of compiling 2.99, can I copy include from 2.99 to 2.0.11?
User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Post by joevano »

broken tank over there wrote:Would it be good to give points to the whole team?

Also, insead of compiling 2.99, can I copy include from 2.99 to 2.0.11?
No, much has changed from 2.0.11 to 2.99
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

I made a mistake, I wrote COMPATIBLE when I meant to write, INCOMPATIBLE, sorry about that. You can NOT do what you want in 2.0.x, you must WAIT until the next release.

There is NO way to make 2.0.x change scores other then the existing hard coded logic on the client.

3.0 uses totally different networking messages then 2.0.x and it's those networking messages that are broken in 2.0.x and prevent the score from being changed.
ImageJeffM
Post Reply