Author Topic: Counting  (Read 2412 times)

0 Members and 1 Guest are viewing this topic.

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Counting
« on: July 23, 2012, 06:46:34 pm »
I want to try to make a command that says /c wanted and it should tell how many people that are wanted in the server and I was looking at !admins and !warns but I feel that is a little too complex for me. I don't how how to work in the parts with the ++ like at the very end of the script.

I have my IsWanted[playerid] but how would i make it count everyone who is wanted in the server

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Re: Counting
« Reply #1 on: July 25, 2012, 07:09:46 am »
Can I please get some help here, I think this is the heart of the cops and the functions cops get to have.

Offline cocky

  • Street Thug
  • *
  • Posts: 24
    • View Profile
Re: Counting
« Reply #2 on: July 31, 2012, 06:16:43 pm »
I forgot pawn so... Let me try editing the !admins command post it here :D

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Counting
« Reply #3 on: July 31, 2012, 08:15:38 pm »
What's the index that points or designates a wanted player ( for example: Wanted[MAX_PLAYERS] 0 / != 0 ; ) ?

What is the name of the array ( in my example, it's Wanted )
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Re: Counting
« Reply #4 on: August 02, 2012, 04:56:27 am »
Well I'm using IsSuspected[MAX_PLAYERS] at the top but nothing left on the side. I only have something on the side to tell the script that they have to be suspected/wanted or if they are suspected or wanted. So I'm mostly using == and =. Hero made this wanted for me but this is never going to work because it can't count something that hasent been added. How would I fix this to compile with IsSuspected

[pawn]enum pwanted
{
   iswanted
}
[/pawn]

[pawn]
new wantedinfo[ MAX_PLAYERS ][ pwanted ];[/pawn]

[pawn]}
      else if ( strcmp( cmd, "wanted", true ) == 0 )
      {
      new szMsg[ 128 ];
      tmp = strtok( cmdtext, idx );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "*****Please Log-In First*****" );
      else
      {
           for( new i = 0; i <= GetMaxPlayers(); i++ )
         if(wantedinfo[iswanted] == 1)
         {
         format( szMsg, sizeof( szMsg ), "Wanted List: %s",i);
         SendClientMessage(playerid, COLOR_YELLOW, szMsg );
         }
      }
      return 1;[/pawn]