Wanted
#1

Hello all. I have command /wanted wich shows all server wanted people. But here is the problem. All people shows in one line and when wanted people are too much line doesn't shows. Can you tell me how to do that people would show in next line? Here is the command:

Код:
if(!strcmp(cmdtext, "/wanted", true))
  {
		new zin[256] = "* Wanted people:";
  	new name[MAX_PLAYER_NAME];
  	for(new i = 0; i <MAX_PLAYERS; i++){
			if(IsPlayerConnected(i) && GetPlayerWantedLevel(i)>0){
				GetPlayerName(i,name,MAX_PLAYER_NAME);
				format(zin,256,"%s %s(%i levels),",zin,name,GetPlayerWantedLevel(i));
			}
		}
		SendClientMessage(playerid,green,zin);
		return 1;
	}
Reply
#2

So can someone help me?
Reply
#3

Make a check if the size of the string is bigger than something, then use 2 lines.
Reply
#4

Something wrong in your code.
Move SendClientMessage into the loop.
Reply
#5

Quote:
Originally Posted by Matthias_
Make a check if the size of the string is bigger than something, then use 2 lines.
I know that I need to do something like this : if( strlen(zin) > 256) But I can't do it.
Reply
#6

removed
Reply
#7

So nobody can help me?? This is help forum and I'm looking for it.
Reply
#8

format(zin,256,"%s %s(%i levels),",zin,name,GetPlayerWantedLevel(i));

wtf?

how u can use zin in zin?
Reply
#9

Quote:
Originally Posted by lakierka
So nobody can help me?? This is help forum and I'm looking for it.
Hmmm...
Quote:
Originally Posted by yezizhu
Something wrong in your code.
Move SendClientMessage into the loop.
Quote:
Originally Posted by saiberfun
format(zin,256,"%s %s(%i levels),",zin,name,GetPlayerWantedLevel(i));

wtf?

how u can use zin in zin?
It works, you can test yourself.
Reply
#10

So nobody knows?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)