Two questions
#1

Me again. I have two questions regarding scripting.

1. How can I get the total amount of wanted players online? I kinda know what to do but don't know how to put it into script, if that makes sense.

2. I want to display wanted players in a dialog, how would I go around doing this? I assume it's fairly similar to the above.

Thanks in advance. (:
Reply
#2

Код:
// if you use foreach, you can use Iterators, read about that.
// if you use foreach, but you don`t want to use Iterators, you can make this:

// This will show your wanted players in a dialog.
new dialogStr[500], m, playerName[24];
foreach(new x: Player) {
	if(pWantedPoints[x] > 0) {
		m += 24;
		GetPlayerName(x, playerName, 24);
		format(dialogStr, m, "%s\n%s, dialogStr, playerName");
	}
	ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Wanted Players", dialogStr, "Ok", "");
}
// If you don`t use foreach, you have to replace "foreach(new x: Player)" with "for(new x = 0, y = GetPLayerPoolSize(); x != y; x++)"
+rep ? )
Reply
#3

Let's make an example with the VAR's. Once you are setting the player wanted level somewhere in your script do it like this, so you can check later what is the player wanted level.

Код:
SetPlayerWantedLevel(playerid, GetPVarInt(playerid, "WantedLevel")+1);
This would be the list of people who are wanted and their wanted level.

Код:
CMD:wantedlist(playerid)
{
    new count=0, string[500];
    format(string, sizeof(string), "");

    foreach(new i : Player)
    {
       if(GetPVarInt(i, "WantedLevel") > 0)
       {
         format(string, sizeof(string), "%s%s   Wanted Level: %d\n", string, GetPlayerName[i], GetPVarInt(i, "WantedLevel"));
		 count++;
	   }
    }
    if(count==0) SendClientMessage(playerid, -1, "* No players online with wanted level.");
    else
    ShowPlayerDialog(playerid, dialog_ID, DIALOG_STYLE_MSGBOX, "Wanted list", string, "Ok", "");
    return 1;

}
Be sure to change some things in this code, this is just as an example.
Reply
#4

I'll test both of your codes later and then give you the result. Also, I'll rep both of you now. Thanks!

Edit: I can only rep one of you because I repped other players. I'll rep when I can.
Reply
#5

There is probably a faster and easier way but this works.

This will show 20 playernames with wanted level lowest playerID ontop.

PHP код:

#define DIALOG_WANTEDPLAYERS 1
public OnPlayerCommandText(playeridcmdtext[])
{
if(!
strcmp(cmdtext"/wantedplayers"true))
{
new 
TotalWantedPlayers 0;
new 
PlayerCheck 0;
new 
StringSlot 1;
new 
NameSlot1[64];
new 
NameSlot2[64];
new 
NameSlot3[64];
new 
NameSlot4[64];
new 
NameSlot5[64];
new 
NameSlot6[64];
new 
NameSlot7[64];
new 
NameSlot8[64];
new 
NameSlot9[64];
new 
NameSlot10[64];
new 
NameSlot11[64];
new 
NameSlot12[64];
new 
NameSlot13[64];
new 
NameSlot14[64];
new 
NameSlot15[64];
new 
NameSlot16[64];
new 
NameSlot17[64];
new 
NameSlot18[64];
new 
NameSlot19[64];
new 
NameSlot20[64];
while(
PlayerCheck<MAX_PLAYERS && StringSlot 21)
{
if(
GetPlayerWantedLevel(PlayerCheck) > 0)
{
if(
StringSlot == 1)
{
GetPlayerName(playeridNameSlot1MAX_PLAYER_NAME+1);
}
if(
StringSlot == 2)
{
GetPlayerName(playeridNameSlot2MAX_PLAYER_NAME+1);
}
if(
StringSlot == 3)
{
GetPlayerName(playeridNameSlot3MAX_PLAYER_NAME+1);
}
if(
StringSlot == 4)
{
GetPlayerName(playeridNameSlot4MAX_PLAYER_NAME+1);
}
if(
StringSlot == 5)
{
GetPlayerName(playeridNameSlot5MAX_PLAYER_NAME+1);
}
if(
StringSlot == 6)
{
GetPlayerName(playeridNameSlot6MAX_PLAYER_NAME+1);
}
if(
StringSlot == 7)
{
GetPlayerName(playeridNameSlot7MAX_PLAYER_NAME+1);
}
if(
StringSlot == 8)
{
GetPlayerName(playeridNameSlot8MAX_PLAYER_NAME+1);
}
if(
StringSlot == 9)
{
GetPlayerName(playeridNameSlot9MAX_PLAYER_NAME+1);
}
if(
StringSlot == 10)
{
GetPlayerName(playeridNameSlot10MAX_PLAYER_NAME+1);
}
if(
StringSlot == 11)
{
GetPlayerName(playeridNameSlot11MAX_PLAYER_NAME+1);
}
if(
StringSlot == 12)
{
GetPlayerName(playeridNameSlot12MAX_PLAYER_NAME+1);
}
if(
StringSlot == 13)
{
GetPlayerName(playeridNameSlot13MAX_PLAYER_NAME+1);
}
if(
StringSlot == 14)
{
GetPlayerName(playeridNameSlot14MAX_PLAYER_NAME+1);
}
if(
StringSlot == 15)
{
GetPlayerName(playeridNameSlot15MAX_PLAYER_NAME+1);
}
if(
StringSlot == 16)
{
GetPlayerName(playeridNameSlot16MAX_PLAYER_NAME+1);
}
if(
StringSlot == 17)
{
GetPlayerName(playeridNameSlot17MAX_PLAYER_NAME+1);
}
if(
StringSlot == 18)
{
GetPlayerName(playeridNameSlot18MAX_PLAYER_NAME+1);
}
if(
StringSlot == 19)
{
GetPlayerName(playeridNameSlot19MAX_PLAYER_NAME+1);
}
if(
StringSlot == 20)
{
GetPlayerName(playeridNameSlot20MAX_PLAYER_NAME+1);
}
StringSlot StringSlot+1;
TotalWantedPlayers TotalWantedPlayers+1;
}
PlayerCheck PlayerCheck+1;
}
new 
string[256];
format(string,sizeof(string),"Total wanted players: %d"TotalWantedPlayers);
SendClientMessage(playerid,-1,string);
new 
TwentyNamesString[1280];
format(TwentyNamesString,sizeof TwentyNamesString,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",NameSlot1,NameSlot2,NameSlot3,NameSlot4,NameSlot5,NameSlot6,NameSlot7,NameSlot8,NameSlot9,NameSlot10,NameSlot11,NameSlot12,NameSlot13,NameSlot14,NameSlot15,NameSlot16,NameSlot17,NameSlot18,NameSlot19,NameSlot20);
ShowPlayerDialog(playeridDIALOG_WANTEDPLAYERSDIALOG_STYLE_MSGBOX"Wanted Players"TwentyNamesString"Close""");
return 
1;
}
return 
0;

Reply
#6

Quote:
Originally Posted by MEGADETHS
Посмотреть сообщение
There is probably a faster and easier way but this works.

This will show 20 playernames with wanted level lowest playerID ontop.

PHP код:

#define DIALOG_WANTEDPLAYERS 1
public OnPlayerCommandText(playeridcmdtext[])
{
if(!
strcmp(cmdtext"/wantedplayers"true))
{
new 
TotalWantedPlayers 0;
new 
PlayerCheck 0;
new 
StringSlot 1;
new 
NameSlot1[64];
new 
NameSlot2[64];
new 
NameSlot3[64];
new 
NameSlot4[64];
new 
NameSlot5[64];
new 
NameSlot6[64];
new 
NameSlot7[64];
new 
NameSlot8[64];
new 
NameSlot9[64];
new 
NameSlot10[64];
new 
NameSlot11[64];
new 
NameSlot12[64];
new 
NameSlot13[64];
new 
NameSlot14[64];
new 
NameSlot15[64];
new 
NameSlot16[64];
new 
NameSlot17[64];
new 
NameSlot18[64];
new 
NameSlot19[64];
new 
NameSlot20[64];
while(
PlayerCheck<MAX_PLAYERS && StringSlot 21)
{
if(
GetPlayerWantedLevel(PlayerCheck) > 0)
{
if(
StringSlot == 1)
{
GetPlayerName(playeridNameSlot1MAX_PLAYER_NAME+1);
}
if(
StringSlot == 2)
{
GetPlayerName(playeridNameSlot2MAX_PLAYER_NAME+1);
}
if(
StringSlot == 3)
{
GetPlayerName(playeridNameSlot3MAX_PLAYER_NAME+1);
}
if(
StringSlot == 4)
{
GetPlayerName(playeridNameSlot4MAX_PLAYER_NAME+1);
}
if(
StringSlot == 5)
{
GetPlayerName(playeridNameSlot5MAX_PLAYER_NAME+1);
}
if(
StringSlot == 6)
{
GetPlayerName(playeridNameSlot6MAX_PLAYER_NAME+1);
}
if(
StringSlot == 7)
{
GetPlayerName(playeridNameSlot7MAX_PLAYER_NAME+1);
}
if(
StringSlot == 8)
{
GetPlayerName(playeridNameSlot8MAX_PLAYER_NAME+1);
}
if(
StringSlot == 9)
{
GetPlayerName(playeridNameSlot9MAX_PLAYER_NAME+1);
}
if(
StringSlot == 10)
{
GetPlayerName(playeridNameSlot10MAX_PLAYER_NAME+1);
}
if(
StringSlot == 11)
{
GetPlayerName(playeridNameSlot11MAX_PLAYER_NAME+1);
}
if(
StringSlot == 12)
{
GetPlayerName(playeridNameSlot12MAX_PLAYER_NAME+1);
}
if(
StringSlot == 13)
{
GetPlayerName(playeridNameSlot13MAX_PLAYER_NAME+1);
}
if(
StringSlot == 14)
{
GetPlayerName(playeridNameSlot14MAX_PLAYER_NAME+1);
}
if(
StringSlot == 15)
{
GetPlayerName(playeridNameSlot15MAX_PLAYER_NAME+1);
}
if(
StringSlot == 16)
{
GetPlayerName(playeridNameSlot16MAX_PLAYER_NAME+1);
}
if(
StringSlot == 17)
{
GetPlayerName(playeridNameSlot17MAX_PLAYER_NAME+1);
}
if(
StringSlot == 18)
{
GetPlayerName(playeridNameSlot18MAX_PLAYER_NAME+1);
}
if(
StringSlot == 19)
{
GetPlayerName(playeridNameSlot19MAX_PLAYER_NAME+1);
}
if(
StringSlot == 20)
{
GetPlayerName(playeridNameSlot20MAX_PLAYER_NAME+1);
}
StringSlot StringSlot+1;
TotalWantedPlayers TotalWantedPlayers+1;
}
PlayerCheck PlayerCheck+1;
}
new 
string[256];
format(string,sizeof(string),"Total wanted players: %d"TotalWantedPlayers);
SendClientMessage(playerid,-1,string);
new 
TwentyNamesString[1280];
format(TwentyNamesString,sizeof TwentyNamesString,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",NameSlot1,NameSlot2,NameSlot3,NameSlot4,NameSlot5,NameSlot6,NameSlot7,NameSlot8,NameSlot9,NameSlot10,NameSlot11,NameSlot12,NameSlot13,NameSlot14,NameSlot15,NameSlot16,NameSlot17,NameSlot18,NameSlot19,NameSlot20);
ShowPlayerDialog(playeridDIALOG_WANTEDPLAYERSDIALOG_STYLE_MSGBOX"Wanted Players"TwentyNamesString"Close""");
return 
1;
}
return 
0;

'Faster and Easier' ?

Take a knife and stab yourself, something like this isn't even for a half-star.
Reply
#7

Quote:
Originally Posted by Bolex_
Посмотреть сообщение
'Faster and Easier' ?

Take a knife and stab yourself, something like this isn't even for a half-star.
And the way you answered him is worse than everything. Moderate your language, please.
Reply
#8

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
And the way you answered him is worse than everything. Moderate your language, please.
Speaking of how to behave @Dayrion, your history is 'very clear'.
Reply
#9

Quote:
Originally Posted by MEGADETHS
Посмотреть сообщение
There is probably a faster and easier way but this works.

This will show 20 playernames with wanted level lowest playerID ontop.

PHP код:

#define DIALOG_WANTEDPLAYERS 1
public OnPlayerCommandText(playeridcmdtext[])
{
if(!
strcmp(cmdtext"/wantedplayers"true))
{
new 
TotalWantedPlayers 0;
new 
PlayerCheck 0;
new 
StringSlot 1;
new 
NameSlot1[64];
new 
NameSlot2[64];
new 
NameSlot3[64];
new 
NameSlot4[64];
new 
NameSlot5[64];
new 
NameSlot6[64];
new 
NameSlot7[64];
new 
NameSlot8[64];
new 
NameSlot9[64];
new 
NameSlot10[64];
new 
NameSlot11[64];
new 
NameSlot12[64];
new 
NameSlot13[64];
new 
NameSlot14[64];
new 
NameSlot15[64];
new 
NameSlot16[64];
new 
NameSlot17[64];
new 
NameSlot18[64];
new 
NameSlot19[64];
new 
NameSlot20[64];
while(
PlayerCheck<MAX_PLAYERS && StringSlot 21)
{
if(
GetPlayerWantedLevel(PlayerCheck) > 0)
{
if(
StringSlot == 1)
{
GetPlayerName(playeridNameSlot1MAX_PLAYER_NAME+1);
}
if(
StringSlot == 2)
{
GetPlayerName(playeridNameSlot2MAX_PLAYER_NAME+1);
}
if(
StringSlot == 3)
{
GetPlayerName(playeridNameSlot3MAX_PLAYER_NAME+1);
}
if(
StringSlot == 4)
{
GetPlayerName(playeridNameSlot4MAX_PLAYER_NAME+1);
}
if(
StringSlot == 5)
{
GetPlayerName(playeridNameSlot5MAX_PLAYER_NAME+1);
}
if(
StringSlot == 6)
{
GetPlayerName(playeridNameSlot6MAX_PLAYER_NAME+1);
}
if(
StringSlot == 7)
{
GetPlayerName(playeridNameSlot7MAX_PLAYER_NAME+1);
}
if(
StringSlot == 8)
{
GetPlayerName(playeridNameSlot8MAX_PLAYER_NAME+1);
}
if(
StringSlot == 9)
{
GetPlayerName(playeridNameSlot9MAX_PLAYER_NAME+1);
}
if(
StringSlot == 10)
{
GetPlayerName(playeridNameSlot10MAX_PLAYER_NAME+1);
}
if(
StringSlot == 11)
{
GetPlayerName(playeridNameSlot11MAX_PLAYER_NAME+1);
}
if(
StringSlot == 12)
{
GetPlayerName(playeridNameSlot12MAX_PLAYER_NAME+1);
}
if(
StringSlot == 13)
{
GetPlayerName(playeridNameSlot13MAX_PLAYER_NAME+1);
}
if(
StringSlot == 14)
{
GetPlayerName(playeridNameSlot14MAX_PLAYER_NAME+1);
}
if(
StringSlot == 15)
{
GetPlayerName(playeridNameSlot15MAX_PLAYER_NAME+1);
}
if(
StringSlot == 16)
{
GetPlayerName(playeridNameSlot16MAX_PLAYER_NAME+1);
}
if(
StringSlot == 17)
{
GetPlayerName(playeridNameSlot17MAX_PLAYER_NAME+1);
}
if(
StringSlot == 18)
{
GetPlayerName(playeridNameSlot18MAX_PLAYER_NAME+1);
}
if(
StringSlot == 19)
{
GetPlayerName(playeridNameSlot19MAX_PLAYER_NAME+1);
}
if(
StringSlot == 20)
{
GetPlayerName(playeridNameSlot20MAX_PLAYER_NAME+1);
}
StringSlot StringSlot+1;
TotalWantedPlayers TotalWantedPlayers+1;
}
PlayerCheck PlayerCheck+1;
}
new 
string[256];
format(string,sizeof(string),"Total wanted players: %d"TotalWantedPlayers);
SendClientMessage(playerid,-1,string);
new 
TwentyNamesString[1280];
format(TwentyNamesString,sizeof TwentyNamesString,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",NameSlot1,NameSlot2,NameSlot3,NameSlot4,NameSlot5,NameSlot6,NameSlot7,NameSlot8,NameSlot9,NameSlot10,NameSlot11,NameSlot12,NameSlot13,NameSlot14,NameSlot15,NameSlot16,NameSlot17,NameSlot18,NameSlot19,NameSlot20);
ShowPlayerDialog(playeridDIALOG_WANTEDPLAYERSDIALOG_STYLE_MSGBOX"Wanted Players"TwentyNamesString"Close""");
return 
1;
}
return 
0;

WOW YOU MADE MY DAY
Reply
#10

That's more like a whose script is better contest
Reply
#11

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
That's more like a whose script is better contest
Obviously this one:

Quote:
Originally Posted by MEGADETHS
Посмотреть сообщение
There is probably a faster and easier way but this works.

This will show 20 playernames with wanted level lowest playerID ontop.

PHP код:

#define DIALOG_WANTEDPLAYERS 1
public OnPlayerCommandText(playeridcmdtext[])
{
if(!
strcmp(cmdtext"/wantedplayers"true))
{
new 
TotalWantedPlayers 0;
new 
PlayerCheck 0;
new 
StringSlot 1;
new 
NameSlot1[64];
new 
NameSlot2[64];
new 
NameSlot3[64];
new 
NameSlot4[64];
new 
NameSlot5[64];
new 
NameSlot6[64];
new 
NameSlot7[64];
new 
NameSlot8[64];
new 
NameSlot9[64];
new 
NameSlot10[64];
new 
NameSlot11[64];
new 
NameSlot12[64];
new 
NameSlot13[64];
new 
NameSlot14[64];
new 
NameSlot15[64];
new 
NameSlot16[64];
new 
NameSlot17[64];
new 
NameSlot18[64];
new 
NameSlot19[64];
new 
NameSlot20[64];
while(
PlayerCheck<MAX_PLAYERS && StringSlot 21)
{
if(
GetPlayerWantedLevel(PlayerCheck) > 0)
{
if(
StringSlot == 1)
{
GetPlayerName(playeridNameSlot1MAX_PLAYER_NAME+1);
}
if(
StringSlot == 2)
{
GetPlayerName(playeridNameSlot2MAX_PLAYER_NAME+1);
}
if(
StringSlot == 3)
{
GetPlayerName(playeridNameSlot3MAX_PLAYER_NAME+1);
}
if(
StringSlot == 4)
{
GetPlayerName(playeridNameSlot4MAX_PLAYER_NAME+1);
}
if(
StringSlot == 5)
{
GetPlayerName(playeridNameSlot5MAX_PLAYER_NAME+1);
}
if(
StringSlot == 6)
{
GetPlayerName(playeridNameSlot6MAX_PLAYER_NAME+1);
}
if(
StringSlot == 7)
{
GetPlayerName(playeridNameSlot7MAX_PLAYER_NAME+1);
}
if(
StringSlot == 8)
{
GetPlayerName(playeridNameSlot8MAX_PLAYER_NAME+1);
}
if(
StringSlot == 9)
{
GetPlayerName(playeridNameSlot9MAX_PLAYER_NAME+1);
}
if(
StringSlot == 10)
{
GetPlayerName(playeridNameSlot10MAX_PLAYER_NAME+1);
}
if(
StringSlot == 11)
{
GetPlayerName(playeridNameSlot11MAX_PLAYER_NAME+1);
}
if(
StringSlot == 12)
{
GetPlayerName(playeridNameSlot12MAX_PLAYER_NAME+1);
}
if(
StringSlot == 13)
{
GetPlayerName(playeridNameSlot13MAX_PLAYER_NAME+1);
}
if(
StringSlot == 14)
{
GetPlayerName(playeridNameSlot14MAX_PLAYER_NAME+1);
}
if(
StringSlot == 15)
{
GetPlayerName(playeridNameSlot15MAX_PLAYER_NAME+1);
}
if(
StringSlot == 16)
{
GetPlayerName(playeridNameSlot16MAX_PLAYER_NAME+1);
}
if(
StringSlot == 17)
{
GetPlayerName(playeridNameSlot17MAX_PLAYER_NAME+1);
}
if(
StringSlot == 18)
{
GetPlayerName(playeridNameSlot18MAX_PLAYER_NAME+1);
}
if(
StringSlot == 19)
{
GetPlayerName(playeridNameSlot19MAX_PLAYER_NAME+1);
}
if(
StringSlot == 20)
{
GetPlayerName(playeridNameSlot20MAX_PLAYER_NAME+1);
}
StringSlot StringSlot+1;
TotalWantedPlayers TotalWantedPlayers+1;
}
PlayerCheck PlayerCheck+1;
}
new 
string[256];
format(string,sizeof(string),"Total wanted players: %d"TotalWantedPlayers);
SendClientMessage(playerid,-1,string);
new 
TwentyNamesString[1280];
format(TwentyNamesString,sizeof TwentyNamesString,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",NameSlot1,NameSlot2,NameSlot3,NameSlot4,NameSlot5,NameSlot6,NameSlot7,NameSlot8,NameSlot9,NameSlot10,NameSlot11,NameSlot12,NameSlot13,NameSlot14,NameSlot15,NameSlot16,NameSlot17,NameSlot18,NameSlot19,NameSlot20);
ShowPlayerDialog(playeridDIALOG_WANTEDPLAYERSDIALOG_STYLE_MSGBOX"Wanted Players"TwentyNamesString"Close""");
return 
1;
}
return 
0;

Reply
#12

Quote:
Originally Posted by Bolex_
Посмотреть сообщение
'Faster and Easier' ?

Take a knife and stab yourself, something like this isn't even for a half-star.
It wasn't meant to be a 5 star answer, I also don't recall asking your opinion.
Reply
#13

This turned from a question to a war real fast lol
Reply
#14

Believe me this is the best answer:

Quote:
Originally Posted by Kasichok
Посмотреть сообщение
The guys from up i dont know whats wrong with them one never heard of loops the other uses pvar for some reason instead of just checking if player is wanted

pawn Код:
CMD:wanted(playerid)
{
    new count = 0, string[500], name[26];
    format(string, 500, "");
    for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
    {
        if(GetPlayerWantedLevel(i) < 1) continue;
        count ++;
        GetPlayerName(i, name, 24);
        format(name, 500, "%s\n", name);
        strcat(string, name);
    }
    if(count > 0)
    {
        ShowPlayerDialog(playerid, 1200, DIALOG_STYLE_LIST, "Wanted Players", string, "Ok", "Cancel");
    }
    else
    {
        SendClientMessage(playerid, 0xFF0000FF, "No one wanted");
    }
    return 1;
}
Reply
#15

no megadeths
Reply
#16

Quote:
Originally Posted by MEGADETHS
Посмотреть сообщение
There is probably a faster and easier way but this works.

This will show 20 playernames with wanted level lowest playerID ontop.

PHP код:

#define DIALOG_WANTEDPLAYERS 1
public OnPlayerCommandText(playeridcmdtext[])
{
if(!
strcmp(cmdtext"/wantedplayers"true))
{
new 
TotalWantedPlayers 0;
new 
PlayerCheck 0;
new 
StringSlot 1;
new 
NameSlot1[64];
new 
NameSlot2[64];
new 
NameSlot3[64];
new 
NameSlot4[64];
new 
NameSlot5[64];
new 
NameSlot6[64];
new 
NameSlot7[64];
new 
NameSlot8[64];
new 
NameSlot9[64];
new 
NameSlot10[64];
new 
NameSlot11[64];
new 
NameSlot12[64];
new 
NameSlot13[64];
new 
NameSlot14[64];
new 
NameSlot15[64];
new 
NameSlot16[64];
new 
NameSlot17[64];
new 
NameSlot18[64];
new 
NameSlot19[64];
new 
NameSlot20[64];
while(
PlayerCheck<MAX_PLAYERS && StringSlot 21)
{
if(
GetPlayerWantedLevel(PlayerCheck) > 0)
{
if(
StringSlot == 1)
{
GetPlayerName(playeridNameSlot1MAX_PLAYER_NAME+1);
}
if(
StringSlot == 2)
{
GetPlayerName(playeridNameSlot2MAX_PLAYER_NAME+1);
}
if(
StringSlot == 3)
{
GetPlayerName(playeridNameSlot3MAX_PLAYER_NAME+1);
}
if(
StringSlot == 4)
{
GetPlayerName(playeridNameSlot4MAX_PLAYER_NAME+1);
}
if(
StringSlot == 5)
{
GetPlayerName(playeridNameSlot5MAX_PLAYER_NAME+1);
}
if(
StringSlot == 6)
{
GetPlayerName(playeridNameSlot6MAX_PLAYER_NAME+1);
}
if(
StringSlot == 7)
{
GetPlayerName(playeridNameSlot7MAX_PLAYER_NAME+1);
}
if(
StringSlot == 8)
{
GetPlayerName(playeridNameSlot8MAX_PLAYER_NAME+1);
}
if(
StringSlot == 9)
{
GetPlayerName(playeridNameSlot9MAX_PLAYER_NAME+1);
}
if(
StringSlot == 10)
{
GetPlayerName(playeridNameSlot10MAX_PLAYER_NAME+1);
}
if(
StringSlot == 11)
{
GetPlayerName(playeridNameSlot11MAX_PLAYER_NAME+1);
}
if(
StringSlot == 12)
{
GetPlayerName(playeridNameSlot12MAX_PLAYER_NAME+1);
}
if(
StringSlot == 13)
{
GetPlayerName(playeridNameSlot13MAX_PLAYER_NAME+1);
}
if(
StringSlot == 14)
{
GetPlayerName(playeridNameSlot14MAX_PLAYER_NAME+1);
}
if(
StringSlot == 15)
{
GetPlayerName(playeridNameSlot15MAX_PLAYER_NAME+1);
}
if(
StringSlot == 16)
{
GetPlayerName(playeridNameSlot16MAX_PLAYER_NAME+1);
}
if(
StringSlot == 17)
{
GetPlayerName(playeridNameSlot17MAX_PLAYER_NAME+1);
}
if(
StringSlot == 18)
{
GetPlayerName(playeridNameSlot18MAX_PLAYER_NAME+1);
}
if(
StringSlot == 19)
{
GetPlayerName(playeridNameSlot19MAX_PLAYER_NAME+1);
}
if(
StringSlot == 20)
{
GetPlayerName(playeridNameSlot20MAX_PLAYER_NAME+1);
}
StringSlot StringSlot+1;
TotalWantedPlayers TotalWantedPlayers+1;
}
PlayerCheck PlayerCheck+1;
}
new 
string[256];
format(string,sizeof(string),"Total wanted players: %d"TotalWantedPlayers);
SendClientMessage(playerid,-1,string);
new 
TwentyNamesString[1280];
format(TwentyNamesString,sizeof TwentyNamesString,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",NameSlot1,NameSlot2,NameSlot3,NameSlot4,NameSlot5,NameSlot6,NameSlot7,NameSlot8,NameSlot9,NameSlot10,NameSlot11,NameSlot12,NameSlot13,NameSlot14,NameSlot15,NameSlot16,NameSlot17,NameSlot18,NameSlot19,NameSlot20);
ShowPlayerDialog(playeridDIALOG_WANTEDPLAYERSDIALOG_STYLE_MSGBOX"Wanted Players"TwentyNamesString"Close""");
return 
1;
}
return 
0;

what did I just read

i'm not even drunk

@Kasichok: A string size of 500? Also according to Sa-Mp limits, MAX_PLAYER_NAME is 24 not 26

damn i have to print this topic
Reply
#17

Quote:
Originally Posted by SymonClash
Посмотреть сообщение
what did I just read

i'm not even drunk

@Kasichok: A string size of 500? Also according to Sa-Mp limits, MAX_PLAYER_NAME is 24 not 26

damn i have to print this topic
i use new line \n with the name 24+2=26 \n%s, now string of 500 yes imagine there are 100 wanted players in the server so 26*100=260 and there could be even more.
Reply
#18

Slightly puzzled what script is better. However, has anyone attempted to get the amount of wanted players and display it in a textdraw? That was the other question. Another debate? :thonk:
Reply
#19

Inside of the format add an argument which will be

Код:
GetPlayerWantedLevel(i)
To be formatted with the specifier "%i"
Feel free to add a new column to the dialog if you want, or all in one line with the player's name
Reply
#20

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
Inside of the format add an argument which will be

Код:
GetPlayerWantedLevel(i)
To be formatted with the specifier "%i"
Feel free to add a new column to the dialog if you want, or all in one line with the player's name
Thanks but that wasn't what I was asking. I wanted to get the amount of wanted players and then change this 0 to the amount of wanted players. If there are 4 people with a wanted level, it will show 4. If there is 1 person with a wanted level, it would show 1, etc, etc.
https://imgur.com/a/40WnVL4 - image

Edit: Realised you might be talking about the other question or to someone else. Not sure though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)