[HELP] --- /wanted - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] --- /wanted (
/showthread.php?tid=242269)
[HELP] --- /wanted -
bijoyekuza - 19.03.2011
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..
Re: [HELP] --- /wanted -
Serbish - 19.03.2011
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;
}
Re: [HELP] --- /wanted -
xDeadlyBoy - 19.03.2011
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;
}