Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: kitt85711 on July 23, 2012, 06:46:34 pm

Title: Counting
Post by: kitt85711 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
Title: Re: Counting
Post by: kitt85711 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.
Title: Re: Counting
Post by: cocky on July 31, 2012, 06:16:43 pm
I forgot pawn so... Let me try editing the !admins command post it here :D
Title: Re: Counting
Post by: heekz.shadow 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 )
Title: Re: Counting
Post by: kitt85711 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]