help with these errors
#1

Код:
	 
new tcp[MAX_PLAYERS][32];  
                for(new i=0;i<MAX_PLAYERS;i++)
	        {
				new name[MAX_PLAYER_NAME];
				if(GetPlayerName(i,name,sizeof(name))==tcp[playerid])//tcp has a players name stored
				    {
				    leader[i]=inputtext;//wrong input text valuse, i give three and its gives 51
				    break;
				    }
			}
C:\Users\likith\Desktop\3c srvr\gamemodes\EeshRP.pwn(1841) : error 033: array must be indexed (variable "tcp")
C:\Users\likith\Desktop\3c srvr\gamemodes\EeshRP.pwn(1843) : error 006: must be assigned to an array
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

pawn Код:
new tcp[MAX_PLAYERS][32];
for(new i=0; i<GetMaxPlayers(); i++)
{
    if(IsPlayerConnected(i))
    {
        new name[MAX_PLAYER_NAME];
        if(!strcmp(name, tcp[playerid], true))
        {
            leader[i] = inputtext);
            break;
        }
    }
}
Reply
#3

I did it

pawn Код:
new tcp[MAX_PLAYERS][32];
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(i,name,sizeof(name));
        if(strcmp(name,tcp[playerid],true)==0)//tcp has a players name stored
        {
            strmid(leader[i],inputtext,false,strlen(inputtext),128);
            break;
        }
    }
I hope that i have helped
Reply
#4

can you tell me what strmid does?
Reply
#5

the inputtext is still not fixed. if i enter 3 it gives 51 , if i enter 5 it gives 61
Reply
#6

Quote:
pawn Код:
if(GetPlayerName(i,name,sizeof(name))==tcp[playerid])//
Strings can't be compared with "==" use strcmp(string1, string2, true) == 0/1/-1

Returns...
0: When they are equal
1: When the first is longer than the second
-1: When the second is longer than the first
Reply
#7

erm where do i put the endinput? the remaining prob is the inputtext value is wrong. if i enter 3 it gives me 51 for some reason -.-
Reply
#8

LOL ENDINPUT IS MY SIGNATURE... DONT PUT IT XD
Reply
#9

ops lol... but how do i solve the input bug -.-
Reply
#10

pawn Код:
new tcp[MAX_PLAYERS][32];
for(new i=0; i<GetMaxPlayers(); i++)
{
    if(IsPlayerConnected(i))
    {
        new name[MAX_PLAYER_NAME];
        if(!strcmp(name, tcp[playerid], true))
        {
            leader[i] = strval(inputtext);
            break;
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)