GeoIP Command problem.
#1

The command.

pawn Код:
if(strcmp(cmd, "/orasulmeu", true) == 0)
    {
        if(PlayerInfo[playerid][Donator] >= 2)
        {
            new orasultau[456];
            GetPlayerCity(playerid, orasultau, 456);
            new help1[456];
            for(new i; i<MAX_PLAYERS; i++)
            {
                new orasxd[456];
                GetPlayerCity(i,orasxd, 50);
                if( strcmp( orasxd, orasultau, true ) == 0 )
                {
                    format(help1, sizeof(help1), "%s, %s.", GetName(i), help1);

                }
            }
            new helpresult[456];
            format(helpresult, sizeof(helpresult), "(Lista persoane din orasul tau) %s", help1);
            SendSplitMessageEx(playerid, COLOR_GRAD1, helpresult);

        }
        return 1;
    }
The result
http://i.imgur.com/dM9uMT5.png

I want if is nobody with him from the same city to return scm "You're alone." and if somebody is from the same city to look on chat like (lista persoane din orasul tau) Name1,Name2

not to spam ", , ,, " ..
Reply
#2

It's spamming because you're not checking if the player is online or not, add this to your loop:

if(IsPlayerConnected(i)
{
rest of the script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)