15.09.2009, 13:25
Hello, I have a problem with /getid.
I almost get overloaded of warnings and I don't understand them.
The code:
The warnings:
The unreachable code is:
That command is bugged with the /getid command.
Can someone help me? Thanks.
I almost get overloaded of warnings and I don't understand them.
The code:
pawn Код:
if(strcmp(cmd, "/getid", true) == 0)
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /getid [playername]");
new found, string[128], playername[MAX_PLAYER_NAME];
giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,red, "Invalid Player ID.");
{
for(new i=0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, playername, MAX_PLAYER_NAME);
new namelen = strlen(playername);
new bool:searched=false;
for(new pos=0; pos <= namelen; pos++)
{
if(searched != true)
{
if(strfind(playername,tmp,true) == pos)
{
found++;
format(string,sizeof(string),"%d. %s (ID %d)",found,playername,i);
SendClientMessage(playerid, orange ,string);
searched = true;
}
}
}
}
}
if(found == 0) SendClientMessage(playerid, red, "No players have this in their nick");
return 1;
}
Код:
C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(311) : warning 217: loose indentation C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(328) : warning 217: loose indentation C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(332) : warning 225: unreachable code C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(341) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(524) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(536) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(548) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(607) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(632) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(648) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(674) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\Nel\Desktop\Mijn spullen\GTA Games\Server test gta\filterscripts\Test.pwn(697) : warning 219: local variable "string" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 12 Warnings.
pawn Код:
if(strcmp(cmdtext, "/lowrider", true) == 0) {
Can someone help me? Thanks.