error 033: array must be indexed (variable "player")
#1

Код:
else if(dialogid == 104)
    {
        if(response)
        {
            new player[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];
            if(strval(inputtext) == player)
            {
                new id = GetPlayeridMid(player);
               
                if(id==INVALID_PLAYER_ID)
                {
                    SendClientMessage(playerid,RED,"* Tokio zaidejo nera.");
                    return 1;
                }
               
                if(GetPlayerInterior(id) != 0)
                {
                    SendClientMessage(playerid,RED,"* Zaidejo pozicijos nustatyti neimanoma.");
                    return 1;
                }
               
                new kas[128],kiek[128],Float:coo[6];
                GetPlayerName(id,name,sizeof(name));
                GetPlayerPos(id,coo[0],coo[1],coo[2]);
                GetPlayerPos(playerid,coo[3],coo[4],coo[5]);
                new Float:atstumas = ((floatabs(coo[0]-coo[3])+floatabs(coo[1]-coo[4])+floatabs(coo[2]-coo[5]))/3)/100;
                SetPlayerCheckpoint(playerid,coo[0],coo[1],coo[2],2);

               
               
                format(kas,sizeof(kas),"%s",name);
                format(kiek, sizeof(kiek), "%f KM",atstumas);
                TextDrawSetString(Mapp[playerid][0], kas);
                TextDrawSetString(Mapp[playerid][1], kiek);

                Map[playerid] = SetTimerEx("MAPP",500,true,"i",playerid,id);
                return 1;
            }
        }
        return 1;
    }
Line: if(strval(inputtext) == player)
Reply
#2

pawn Код:
if(strval(inputtext) == player[playerid])
Reply
#3

I want code /where player

example: say /where, got GUI INPUT(im have), write playername, if player exists, shos player checkpoint, but im write player, he's online got msg:

This player doesn't exists:

Код:
else if(dialogid == 104)
    {
        if(response)
        {
            new player[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];
            if(strval(inputtext) == player[playerid])
            {
                new id = GetPlayeridMid(player);
               
                if(id==INVALID_PLAYER_ID)
                {
                    SendClientMessage(playerid,RED,"* This player doesn't exists.");
                    return 1;
                }
               
                if(GetPlayerInterior(id) != 0)
                {
                    SendClientMessage(playerid,RED,"* Zaidejo pozicijos nustatyti neimanoma.");
                    return 1;
                }
               
                new kas[128],kiek[128],Float:coo[6];
                GetPlayerName(id,name,sizeof(name));
                GetPlayerPos(id,coo[0],coo[1],coo[2]);
                GetPlayerPos(playerid,coo[3],coo[4],coo[5]);
                new Float:atstumas = ((floatabs(coo[0]-coo[3])+floatabs(coo[1]-coo[4])+floatabs(coo[2]-coo[5]))/3)/100;
                SetPlayerCheckpoint(playerid,coo[0],coo[1],coo[2],2);

               
               
                format(kas,sizeof(kas),"%s",name);
                format(kiek, sizeof(kiek), "%f KM",atstumas);
                TextDrawSetString(Mapp[playerid][0], kas);
                TextDrawSetString(Mapp[playerid][1], kiek);

                Map[playerid] = SetTimerEx("MAPP",500,true,"i",playerid,id);
                return 1;
            }
        }
        return 1;
    }
Reply
#4

Show us your.

pawn Код:
new player
Reply
#5

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
Show us your.

pawn Код:
new player
new player[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];
Reply
#6

Try this
pawn Код:
else if(dialogid == 104)
    {
        if(response)
        {
            new player[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];
            if(sscanf(inputtext, "u", player))
            {
                SendClientMessage(playerid,RED,"* This player doesn't exists.");
                return 1;
            }
            if(GetPlayerInterior(id) != 0)
            {
                SendClientMessage(playerid,RED,"* Zaidejo pozicijos nustatyti neimanoma.");
                return 1;
            }

            new kas[128],kiek[128],Float:coo[6];
            GetPlayerName(id,name,sizeof(name));
            GetPlayerPos(id,coo[0],coo[1],coo[2]);
            GetPlayerPos(playerid,coo[3],coo[4],coo[5]);
            new Float:atstumas = ((floatabs(coo[0]-coo[3])+floatabs(coo[1]-coo[4])+floatabs(coo[2]-coo[5]))/3)/100;
            SetPlayerCheckpoint(playerid,coo[0],coo[1],coo[2],2);



            format(kas,sizeof(kas),"%s",name);
            format(kiek, sizeof(kiek), "%f KM",atstumas);
            TextDrawSetString(Mapp[playerid][0], kas);
            TextDrawSetString(Mapp[playerid][1], kiek);

            Map[playerid] = SetTimerEx("MAPP",500,true,"i",playerid,id);
            return 1;
        }
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
Try this
pawn Код:
else if(dialogid == 104)
    {
        if(response)
        {
            new player[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];
            if(sscanf(inputtext, "u", player))
            {
                SendClientMessage(playerid,RED,"* This player doesn't exists.");
                return 1;
            }
            if(GetPlayerInterior(id) != 0)
            {
                SendClientMessage(playerid,RED,"* Zaidejo pozicijos nustatyti neimanoma.");
                return 1;
            }

            new kas[128],kiek[128],Float:coo[6];
            GetPlayerName(id,name,sizeof(name));
            GetPlayerPos(id,coo[0],coo[1],coo[2]);
            GetPlayerPos(playerid,coo[3],coo[4],coo[5]);
            new Float:atstumas = ((floatabs(coo[0]-coo[3])+floatabs(coo[1]-coo[4])+floatabs(coo[2]-coo[5]))/3)/100;
            SetPlayerCheckpoint(playerid,coo[0],coo[1],coo[2],2);



            format(kas,sizeof(kas),"%s",name);
            format(kiek, sizeof(kiek), "%f KM",atstumas);
            TextDrawSetString(Mapp[playerid][0], kas);
            TextDrawSetString(Mapp[playerid][1], kiek);

            Map[playerid] = SetTimerEx("MAPP",500,true,"i",playerid,id);
            return 1;
        }
    }
    return 1;
}
Got flood, if write doesnt exist player
Reply
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
Am I just talking to myself here? You ignored my first post, till someone else made the same suggestion; then ignored my second post and complained about the problem I already explained how to fix!
im try but doesn't work, you pro scripter, im want learn scripting, but learned from mistakes.
Reply
#9

pawn Код:
else if(dialogid == 104)
    {
        if(response)
        {
            new player[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];

            if(GetPlayerInterior(id) != 0)
            {
                SendClientMessage(playerid,RED,"* Zaidejo pozicijos nustatyti neimanoma.");
                return 1;
            }
            if(!sscanf(inputtext, "u", player))
            {
                new kas[128],kiek[128],Float:coo[6];
                GetPlayerName(id,name,sizeof(name));
                GetPlayerPos(id,coo[0],coo[1],coo[2]);
                GetPlayerPos(playerid,coo[3],coo[4],coo[5]);
                new Float:atstumas = ((floatabs(coo[0]-coo[3])+floatabs(coo[1]-coo[4])+floatabs(coo[2]-coo[5]))/3)/100;
                SetPlayerCheckpoint(playerid,coo[0],coo[1],coo[2],2);

                format(kas,sizeof(kas),"%s",name);
                format(kiek, sizeof(kiek), "%f KM",atstumas);
                TextDrawSetString(Mapp[playerid][0], kas);
                TextDrawSetString(Mapp[playerid][1], kiek);

                Map[playerid] = SetTimerEx("MAPP",500,true,"i",playerid,id);
            }
        }
    }
    return 1;
}
Reply
#10

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
pawn Код:
else if(dialogid == 104)
    {
        if(response)
        {
            new player[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];

            if(GetPlayerInterior(id) != 0)
            {
                SendClientMessage(playerid,RED,"* Zaidejo pozicijos nustatyti neimanoma.");
                return 1;
            }
            if(!sscanf(inputtext, "u", player))
            {
                new kas[128],kiek[128],Float:coo[6];
                GetPlayerName(id,name,sizeof(name));
                GetPlayerPos(id,coo[0],coo[1],coo[2]);
                GetPlayerPos(playerid,coo[3],coo[4],coo[5]);
                new Float:atstumas = ((floatabs(coo[0]-coo[3])+floatabs(coo[1]-coo[4])+floatabs(coo[2]-coo[5]))/3)/100;
                SetPlayerCheckpoint(playerid,coo[0],coo[1],coo[2],2);

                format(kas,sizeof(kas),"%s",name);
                format(kiek, sizeof(kiek), "%f KM",atstumas);
                TextDrawSetString(Mapp[playerid][0], kas);
                TextDrawSetString(Mapp[playerid][1], kiek);

                Map[playerid] = SetTimerEx("MAPP",500,true,"i",playerid,id);
            }
        }
    }
    return 1;
}
Flooding....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)