SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 22/02/2009, 08:46 PM   #1
jesse237
Big Clucker
 
Join Date: Apr 2008
Posts: 112
Reputation: 1
Default /wanted list of persons with wanted [EDIT... problem solved]

hello this is my first topic, i am sorry if it's not in the right place... normally i don't make topics but i'm a lil desperate. I want in my script a command (/wanted) that tells the cop team (TEAM_COP and TEAM_ARMY) which people are wanted. I've heard about loops and stuff that can check all stats of players, i think i need that for it... but i prefer a FS or lines that are complete,

example(not detailed):

sendclientmessage(playerid,blabla, you are checking the list of most wanted players, you can arrest those)
sendclientmessage(playerid,blabla, player1 is wanted, player 6 is wanted )

it would be even greater if it says how much wanted stars!

i thought up this idea myself(meant for cops n gangs server) but a few days later i saw it in a server.. so I know it's possible!!

please help!!!
__________________

www.-.com - where roleplay really starts...(coming soon)
jesse237 is offline  
Old 22/02/2009, 08:49 PM   #2
Zack9764
Huge Clucker
 
Zack9764's Avatar
 
Join Date: Jun 2008
Posts: 416
Reputation: 1
Default Re: /wanted list of persons with wanted

This should work. Shows their wanted level too. Enjoy.

Code:
if(strcmp(cmd, "/wanted", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	 	{
			if(gTeam[playerid] == 2 || IsACop(playerid))
			{
				new x;
				SendClientMessage(playerid, COLOR_GREEN, "Current Wanted Suspects:");
			  for(new i=0; i < MAX_PLAYERS; i++) {
					if(IsPlayerConnected(i))
					{
					  if(WantedLevel[i] > 1)
					  {
							GetPlayerName(i, giveplayer, sizeof(giveplayer));
							format(string, sizeof(string), "%s%s: %d", string,giveplayer,WantedLevel[i]);
							x++;
							if(x > 3) {
							  SendClientMessage(playerid, COLOR_YELLOW, string);
							  x = 0;
								format(string, sizeof(string), "");
							} else {
								format(string, sizeof(string), "%s, ", string);
							}
						}
					}
				}
__________________
Zack9764 is offline  
Old 22/02/2009, 09:22 PM   #3
jesse237
Big Clucker
 
Join Date: Apr 2008
Posts: 112
Reputation: 1
Default Re: /wanted list of persons with wanted

well i get some errors, one of them is that i need to replace: isacop by team_cop.. but i think
the:


my gamemode is a lil shitty (i think somewhere misses a: return, ;, ), } ) on of these so put it in a FS
http://pastebin.com/f2daeaa7d
you can check the errors there yourself ...
__________________

www.-.com - where roleplay really starts...(coming soon)
jesse237 is offline  
Old 22/02/2009, 09:57 PM   #4
jesse237
Big Clucker
 
Join Date: Apr 2008
Posts: 112
Reputation: 1
Default Re: /wanted list of persons with wanted

sorry for double post but i found something, maybe it's right... does:

new WantedLevel;
WantedLevel = GetPlayerWantedLevel(playerid);

needs to be somewhere?

or
WantedLevel[playerid]
or
// Top Of Script
new WantedLevel[MAX_PLAYERS];
__________________

www.-.com - where roleplay really starts...(coming soon)
jesse237 is offline  
Old 23/02/2009, 08:21 AM   #5
Coicatak
Huge Clucker
 
Join Date: Nov 2008
Posts: 321
Reputation: 0
Default Re: /wanted list of persons with wanted

pawn Code:
#define color [your color code]

if(strcmp(cmd, /wanted, true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, color, "Current Wanted Suspects;");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
              new wantedlvl = GetPLayerWantedLevel(i);
              if(wantedlvl > 0)
              {
                    new wantedguy[MAX_PLAYER_NAME];
                    new string[MAX_PLAYER_NAME;
                    GetPlayerName(i, wentedguy, sizeof(wantedguy));
                    format(string, sizeof(string), "Name: %s || Wanted Level: %d", wantedguy, wantedlvl
                    SendClientMessage(playerid, color, string);
               }
         }
        SendClientMessage(playerid, color, "___________________");
    }
    return 1;
}

This should perfectly workbut for every players. If you want it to work only for cops, just add it
Coicatak is offline  
Old 23/02/2009, 01:14 PM   #6
jesse237
Big Clucker
 
Join Date: Apr 2008
Posts: 112
Reputation: 1
Default Re: /wanted list of persons with wanted

nope doesn't work...
__________________

www.-.com - where roleplay really starts...(coming soon)
jesse237 is offline  
Old 23/02/2009, 01:30 PM   #7
jesse237
Big Clucker
 
Join Date: Apr 2008
Posts: 112
Reputation: 1
Default Re: /wanted list of persons with wanted

I got some errors fixed(see red)

Code:
#define COLOR_WHITE 0xFFFFFFAA

 if(strcmp("/wanted", cmdtext, true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, COLOR_WHITE, "Current Wanted Suspects;");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
              new wantedlvl = GetPLayerWantedLevel(playerid);
              if(wantedlvl > 0)
              {
                    new wantedguy[MAX_PLAYER_NAME];
                    new string[MAX_PLAYER_NAME];
                    GetPlayerName(i, wantedguy, sizeof(wantedguy));
                    format(string, sizeof(string), "Name: %s || Wanted Level: %d", wantedguy, wantedlvl);
                    SendClientMessage(playerid, TEAM_CIVIL_COLOR, string);
               }
         }
        SendClientMessage(playerid, COLOR_WHITE, "___________________");
    }
    return 1;
}
the blue line is getting me keeping errors.. maybe someone can give the code to me in/as [FS]filterscript?

EDIT: shit the colors don't work in code... so a lil weird but here:

#define COLOR_WHITE 0xFFFFFFAA

if(strcmp("/wanted", cmdtext, true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_WHITE, "Current Wanted Suspects;");
for(new i = 0; i < MAX_PLAYERS; i++)
{
new wantedlvl = GetPLayerWantedLevel(playerid);
if(wantedlvl > 0)
{
new wantedguy[MAX_PLAYER_NAME];
new string[MAX_PLAYER_NAME];
GetPlayerName(i, wantedguy, sizeof(wantedguy));
format(string, sizeof(string), "Name: %s || Wanted Level: %d", wantedguy, wantedlvl);
SendClientMessage(playerid, TEAM_CIVIL_COLOR, string);
}
}
SendClientMessage(playerid, COLOR_WHITE, "___________________");
}
return 1;
}
__________________

www.-.com - where roleplay really starts...(coming soon)
jesse237 is offline  
Old 23/02/2009, 02:49 PM   #8
jesse237
Big Clucker
 
Join Date: Apr 2008
Posts: 112
Reputation: 1
Default Re: /wanted list of persons with wanted

OK i got it to work
thanks for the help!

good code is this: (it won't show players wantedlevel only if he's wanted or not)

Code:
//at the other #definings!
#define COLOR_WHITE 0xFFFFFFAA

// public OnPlayerCommandText(playerid, cmdtext[])
// {
if(strcmp("/wanted", cmdtext, true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
         SendClientMessage(playerid, COLOR_WHITE, "Current Wanted Suspects;");
         for(new i = 0; i < MAX_PLAYERS; i++)
         {
               new plwl = GetPlayerWantedLevel(i);
               if(plwl > 0)
               {
                    new wantedguy[MAX_PLAYER_NAME];
                    new string[MAX_PLAYER_NAME];
                    GetPlayerName(i, wantedguy, sizeof(wantedguy));
                    format(string, sizeof(string), "Name: %s || Wanted Level: %d", wantedguy, plwl);
                    SendClientMessage(playerid, TEAM_CIVIL_COLOR, string);
               }
         }
         SendClientMessage(playerid, COLOR_WHITE, "___________________");
     }
     return 1;
}

// return 0;

// }
__________________

www.-.com - where roleplay really starts...(coming soon)
jesse237 is offline  
Old 24/02/2009, 10:19 AM   #9
Coicatak
Huge Clucker
 
Join Date: Nov 2008
Posts: 321
Reputation: 0
Default Re: /wanted list of persons with wanted

Quote:
Originally Posted by jesse237
I got some errors fixed(see red)
Arf stupid errors, I'm always forgetting some characters
Coicatak is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP]Problem with wanted sushihusi Help Archive 2 02/03/2010 07:02 PM
[SOLVED]Saving Wanted Level Hijolion Help Archive 13 30/12/2009 12:31 AM
about wanted monster010 Help Archive 2 21/09/2009 06:19 PM
Wanted list Hot Help Archive 0 30/07/2009 10:02 PM


All times are GMT. The time now is 04:39 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.