Sombody help me in this code please!
#2

You shouldn't be using return inside a loop because it will end the loop at the first player that isn't a drug dealer so if there is players after him that are drug dealers it will never get to them.

Try something like this:

pawn Код:
new dealerCount = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(PlayerInfo[i][pSkill] == SKILL_DRUGDEALER)
        dealerCount++;
}
if(dealerCount == 0) return SendClientMessage(playerid,COLOR_RED, "Sorry! There are no drug dealers online at the moment.");
Reply


Messages In This Thread
Sombody help me in this code please! - by Juvanii - 14.10.2014, 17:22
Re: Sombody help me in this code please! - by Chenko - 14.10.2014, 20:24
Re: Sombody help me in this code please! - by Dubya - 14.10.2014, 23:25
Re: Sombody help me in this code please! - by Threshold - 15.10.2014, 01:46
Re: Sombody help me in this code please! - by Juvanii - 15.10.2014, 15:31

Forum Jump:


Users browsing this thread: 1 Guest(s)