Loop problem
#1

Hey everybody!

I am stuck on a loop function(i think).
I've made a command that shows the online helpers, now the problem is, it shows the name of the player that types the command, but it shows it for every helper, so, for example, when I type the command, and there are 4 helpers online, I see Online helpers: Jari Johnson 4 times. Or when my name is Test_Test, i see online helpers: test_test 4 times.

This is the command:

Код HTML:
CMD:helpers(playerid, params[])
{
    for(new i; i<MAX_PLAYERS; i++)
    {
    	if(GetPVarInt(i,"Helper") == 1)
		{
		    if(GetPVarInt(i,"HStatus") == 0)
		    {
			new playername[MAX_PLAYER_NAME], string[84];
			GetPlayerName(playerid, playername, sizeof(playername));
			format(string, sizeof(string), "*%s  "COL_GREEN"[AVAILABLE]",RemoveUnderScore(playerid));
			SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

			}
                    if(GetPVarInt(i,"HStatus") == 1)
		    {
			new playername[MAX_PLAYER_NAME], string[84];
			GetPlayerName(playerid, playername, sizeof(playername));
			format(string, sizeof(string), "*%s  "COL_RED"[UNAVAILABLE]",RemoveUnderScore(playerid));
			SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

			}
	        }
	}
    return 1;

}
Does anybody know what I am doing wrong?
Reply


Messages In This Thread
Loop problem - by Jstylezzz - 11.04.2012, 18:17
Re: Loop problem - by ViniBorn - 11.04.2012, 18:27
Re: Loop problem - by Jstylezzz - 11.04.2012, 18:32
Re: Loop problem - by Skribblez - 11.04.2012, 18:33
Re: Loop problem - by Jstylezzz - 11.04.2012, 18:38

Forum Jump:


Users browsing this thread: 1 Guest(s)