[HELP] --- /wanted
#1

Hey scripters
I want to make a command for cops that shows the wanted players
something like this
Код:
	if(strcmp(cmd,"/wanted",true) == 0)
	{
	    if(PlayerInfo[playerid][pCop] > 2)
	    {
	        for(new i = 0; i < MAX_PLAYERS; i++)
			{
			    if(GetPlayerWantedLevel(i))
			    {
			        new names[MAX_PLAYER_NAME],string[256];
					GetPlayerName(i,names,sizeof(names));
					format(string,sizeof(string),"Wanted players are : %s %s %s",names,names,names);
			    }
			}
	    }
	    return 1;
	}
I dont know how to do this..
Reply
#2

pawn Код:
if(strcmp(cmd,"/wanted",true) == 0)
{
    new string[128], names[MAX_PLAYER_NAME];   
    if(PlayerInfo[playerid][pCop] > 2)
    {
        SendClientMessage(playerid, 0x8C0000FF, "List of wanted people:");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(GetPlayerWantedLevel(i) > 0)
            {
                GetPlayerName(i, names, sizeof(names));
                format(string, sizeof(string), "%s", names);
                SendClientMessage(playerid, 0x8C0000FF, string);
            }
        }
    }
    return 1;
}
Reply
#3

or a better thing:
pawn Код:
if(!strcmp(cmdtext,"/wanted",true))
{
    new string[512], names[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pCop] > 2)
    {
        format(string, sizeof(string), "Wanted People:\n");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(GetPlayerWantedLevel(i) > 0)
            {
                GetPlayerName(i, names, sizeof(names));
                format(string, sizeof(string), "%s%s\n",string, names);
            }
        }
        ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, "Wanted List", string, "OK", "");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)