Clanstats Not Counting member's Kills and deaths

Nihongo^

  • Full Member
  • Posts: 193
Clanstats Not Counting member's Kills and deaths
«  »
Quote from ! on January 1st, 01:57 PM
RegisterClan( player, Clan, Owner.tolower(ss) );
Why is there ss inside brackets?
Ah shit i think i mistakenly wrote "ss" while pasting Code HERE
there's no "ss" on my command i mistakenly put while pasting it
Quote
The message in the server clearly says that the argument OwnerNick received is empty string.
I've fix that problem sir by putting the old gettok function i am facing an other problem now I've added members on db the script is counting my kills and deats ( AS OWNER NOT MEMBER ) but not counting my member's kills/deaths

check the pic kindly i just killed [MD]Test which mean it has to increase Clan deaths too


Which function should i need to show you ?

here's on player kill function

Code: [Select]
if ( status[ killer.ID ].Clan != null )
{
local Clan = status[ killer.ID ].Clan;
IncTagKills( Clan );
}
if ( status[ player.ID ].Clan != null )
{
local Clan = status[ player.ID ].Clan;
IncTagDeaths( Clan );
}

!

  • Sr. Member
  • Don't feel shy while zooming on h*r... >>zeus#5155
  • Posts: 380
Re: Clanstats Not Counting member's Kills and deaths
« Reply #2,  »
Without source or any detail info I can simply throw some steps to follow and post the result here

Steps

1. Make sure if the clan tag of player is not null for a simple debug use this inside onPlayerKill
Code: [Select]
print( "Killer clan is: "+status[ killer.ID ].Clan );
print( "Killed player clan is: "+status[ player.ID ].Clan );
If both of the clans are not null procede to step 2

2. Post the IncTagDeaths( Clan ); maybe there is something wrong in this function which cause the bug.

3. Make sure the clan is registered with proper tag in the database and both the tag in players account and in clans match.
       For sure this step is not necessary cause the kills has been increased means the tags are correct and match, but who knows what you have done in the source maybe you messed a line which cause a bug to update a different tag.

Discord: zeus#5155

Nihongo^

  • Full Member
  • Posts: 193
Re: Clanstats Not Counting member's Kills and deaths
« Reply #3,  »Last edited
Hello Sir first of all i am sorry for giving you late reply i was bit busy with my real life activity really apologize

1)
That's what i get after placing the print function


2)
Here's the function
Code: [Select]
  function IncTagKills( Clan )
  {
  local UP = ClanKills( Clan ) + 1;
  QuerySQL(db, "UPDATE ClanStats SET Kills='"+UP+"' WHERE Clan='"+ Clan+"'");
  //QuerySQL( db, format( "UPDATE ClanStats SET Kills='%i' WHERE Clan='"+Clan+"'", UP ) );
  //local query1 = format( "UPDATE ClanStats SET Kills=%i WHERE Clan='"+Clan+"'", UP );
  //::QuerySQL( ClanStats, query1 );
  }
 
  function IncTagDeaths( Clan )
  {
  local DOWN = ClanDeaths( Clan ) + 1;
  QuerySQL(db, "UPDATE ClanStats SET Deaths='"+DOWN+"' WHERE Clan='"+ Clan+"'");
  //QuerySQL( db, format( "UPDATE ClanStats SET Deaths='%i' WHERE Clan='"+Clan+"'", DOWN ) );
  //local query1 = format( "UPDATE ClanStats SET Deaths=%i WHERE Clan='"+Clan+"'", DOWN );
  //::QuerySQL( ClanStats, query1 );
  }

3)
That's what i put on my database the script not reading the CLan Members column if it start reading it then i can put other tags to like MDt MDr etc


For FULL IMAGE

https://postimg.cc/WdM8g62m
   

!

  • Sr. Member
  • Don't feel shy while zooming on h*r... >>zeus#5155
  • Posts: 380
Re: Clanstats Not Counting member's Kills and deaths
« Reply #6,  »
Quote from Nihongo^ on January 6th, 06:06 AM
1)
That's what i get after placing the print function
And this is the answer to your question in first post.

The player clan was null always means the player was not assigned the clan tag which can be because of a possible bug in a function where the clan tag was assigned upon player join.

Discord: zeus#5155

Nihongo^

  • Full Member
  • Posts: 193
Re: Clanstats Not Counting member's Kills and deaths
« Reply #7,  »Last edited
Quote from ! on January 7th, 11:58 AM
Quote from Nihongo^ on January 6th, 06:06 AM
1)
That's what i get after placing the print function
And this is the answer to your question in first post.

The player clan was null always means the player was not assigned the clan tag which can be because of a possible bug in a function where the clan tag was assigned upon player join.
I don't find any function that assigned tags ( killer or player )  i am bit confused can i show you some codes via pm ? If you don't mind ?
P.S isn't this clan stats made by u ?

!

  • Sr. Member
  • Don't feel shy while zooming on h*r... >>zeus#5155
  • Posts: 380
Re: Clanstats Not Counting member's Kills and deaths
« Reply #8,  »
Quote from Nihongo^ on January 7th, 02:52 PM
I don't find any function that assigned tags ( killer or player )  i am bit confused can i show you some codes via pm ? If you don't mind ?
P.S isn't this clan stats made by u ?
First of all the clan system I released was buggy and was developed when I was not sure how the things work the only reason I removed the topic but that one worked well on a blank server if you still have those files try on a blank server it will definitely work except some bugs in few commands PS contact on discord not this forum PM.

There is a function which assigns the tags to player upon joining but I think the problem is not in that function maybe the player was never assigned a clan tag in the database.


I would still recommend you to leave this clan system and make a new one from scratch rather wasting time on bugs.

Discord: zeus#5155

Nihongo^

  • Full Member
  • Posts: 193

AroliS^

  • Newbie
  • Learning of Mike Tyson K.O
  • Posts: 26
Re: Clanstats Not Counting member's Kills and deaths
« Reply #11,  »Last edited
this will allow your clan system to count kills and deaths, -> Not tested it.
I just did these simple function for you if you still need it, just change it according your command.

Code: [Select]
function IncTagKills( clan, kills )
{
QuerySQL( clanstat, "UPDATE ClanStats SET Kills='" +  kills.tointeger() + "' WHERE Clan='" + clan + "'");
print("Clan kills: "+kills.tointeger() )
}

function IncTagDeaths( clan, deaths )
{
QuerySQL( clanstat, "UPDATE ClanStats SET Deads='" +  deaths.tointeger() + "' WHERE Clan='" + clan + "'");
print("Clan deads: "+deaths.tointeger() )
}

function IsClanRegister( clan )
{
        local Result = ::QuerySQL( clanstat, "SELECT Clan FROM ClanStats WHERE Clan='" + clan + "' COLLATE NOCASE" );
        local Reg = ::GetSQLColumnData( Result, 0 ); 
        return ( Reg ) ? Reg : null;
 FreeSQLQuery( Result );
}


and this goes on onplayerkill
Code: [Select]
if ( GetTag( killer.Name ) && IsClanRegister( GetTag( killer.Name ).tolower() ) ) { IncTagKills(  GetTag( killer.Name ), ( pstatus[ killer.ID ].Kills )+1 ); }
if ( GetTag( player.Name ) && IsClanRegister( GetTag( player.Name ).tolower() ) ) { IncTagDeaths(  GetTag( killer.Name ),( pstatus[ player.ID ].Deaths )+1 ); }

cool and here