public OnPlayerText(playerid, text[]) { if(text[0] == ';') { new string[256],name[24]; GetPlayerName(playerid,name,24); format(string, sizeof(string),"*** [TPM] %s(%d): %s", name, playerid, text[1]); for (new i = 0; i < MAX_PLAYERS; i++) --> This is line 9462 { if(IsPlayerConnected(i)) { if(gTeam[i] == gTeam[playerid]) SendClientMessage(i, COLOR_TPM, string); } } return 0; } return 1; }
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\WorldTurfFun.pwn(9462) : warning 219: local variable "i" shadows a variable at a preceding level
Originally Posted by smokey104
Does anyone know how to remove this warning??
Код:
public OnPlayerText(playerid, text[]) { if(text[0] == ';') { new string[256],name[24]; GetPlayerName(playerid,name,24); format(string, sizeof(string),"*** [TPM] %s(%d): %s", name, playerid, text[1]); for (new i = 0; i < MAX_PLAYERS; i++) --> This is line 9462 { if(IsPlayerConnected(i)) { if(gTeam[i] == gTeam[playerid]) SendClientMessage(i, COLOR_TPM, string); } } return 0; } return 1; } Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\WorldTurfFun.pwn(9462) : warning 219: local variable "i" shadows a variable at a preceding level |
public OnPlayerText(playerid, text[]) { if(text[0] == ';') { new string[256],name[24]; GetPlayerName(playerid,name,24); format(string, sizeof(string),"*** [TPM] %s(%d): %s", name, playerid, text[1]); if(IsPlayerConnected(i)) { if(gTeam[i] == gTeam[playerid]) SendClientMessage(i, COLOR_TPM, string); } return 0; } return 1; }
Originally Posted by Swift_
All you jsut did is delete the loop, meaning it will give him errors saying there is no defined symbol of 'i' and the IsPlayerConnected(i)) and gTeam[i] functions won't work correctly.
|
Originally Posted by Swift_
Search through the rest of the OnPlayerText callback for the same loop. If you don't see it, look through your script for new i; as a global variable. If so, you will have to change the variable you are using (in this case 'i') do something else, like 'j'.
|