SA-MP Forums Archive
GeoIP Command problem. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GeoIP Command problem. (/showthread.php?tid=547853)



GeoIP Command problem. - Metharon - 25.11.2014

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 ", , ,, " ..


Re: GeoIP Command problem. - DRCharlie - 25.11.2014

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