SA-MP Forums Archive
Help me - 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: Help me (/showthread.php?tid=581547)



Help me - Edw - 13.07.2015

I get this error myself, can you help me?

error 033: array must be indexed (variable "playerip")

PHP код:
    if(strcmp(cmd"/alias"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pAdmin] >= 1)
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_SERVER"Foloseste: {FFFFFF}/alias [playerid]");
                    return 
1;
                }
                
giveplayerid ReturnUser(tmp);
                new 
playerip[36], playersip[36], count;
                
GetPlayerIp(giveplayeridplayeripsizeof(playerip));
                if(
IsPlayerConnected(giveplayerid))
                {
                    for(new 
0MAX_PLAYERSi++)
                    {
                        if(
IsPlayerConnected(i))
                        {
                            
GetPlayerIp(iplayersipsizeof(playersip));
                            if(
playerip == playersip)
                            {
                                
GetPlayerName(isendernamesizeof(sendername));
                                
format(string256"Conturi online %s: %s"GetName(playerid), sendername);
                                
count ++;
                            }
                        }
                    }
                    if(
count == 0) return SCM(playerid, -1"Acest player nu are mai multe conturi online!");
                    
SCM(playeridCOLOR_WHITEstring);
                    return 
1;
                }
            }
        }
        return 
1;
    } 



Re: Help me - JaydenJason - 13.07.2015

Код:
if(playerip == playersip)
"==" is used to compare simple numbers, not strings.

Use strcmp

Код:
if(!strcmp(playerip, playersip))
https://sampwiki.blast.hk/wiki/Strcmp


Re: Help me - Edw - 13.07.2015

How can you put them all in a row? Put only one player ..