21.10.2011, 10:27
I was trying to make a team chat for my TDM GM, I copied a code from another server changed it to my variables.
But I get those errors. Help me fix this please.
But I get those errors. Help me fix this please.
Код:
if(strcmp(cmdtext, "/team", true) == 0 || strcmp(cmdtext, "/t", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid]) return 1;
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/t)eam [team chat]");
return 1;
}
if(gTeam[playerid] == TEAM_CT)
{
format(string, sizeof(string), "** %s: %s **",PlayerName(playerid), result);
SendClientMessage(playerid, COLOR_BLUE, string);
}
else if(gTeam[playerid] == TEAM_TT)
{
format(string, sizeof(string), "** %s: %s **",PlayerName(playerid), result);
SendClientMessage(playerid, COLOR_RED, string);
}
}
return 1;
}
Код:
C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(419) : error 017: undefined symbol "idx" C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(421) : error 017: undefined symbol "idx" C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(421) : warning 215: expression has no effect C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(423) : error 017: undefined symbol "idx" C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(425) : error 017: undefined symbol "idx" C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(427) : error 017: undefined symbol "idx" C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(428) : error 017: undefined symbol "idx" C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(428) : warning 215: expression has no effect C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(430) : error 017: undefined symbol "idx" C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(438) : error 017: undefined symbol "string" C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(438) : error 017: undefined symbol "string" C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(438) : error 029: invalid expression, assumed zero C:\Users\Chaccour\Desktop\CS\gamemodes\csa.pwn(438) : fatal error 107: too many error messages on one line

