Preceding level variable
#1

warning 219: local variable "giveplayerid" shadows a variable at a preceding level < That x65.

Код:
stock RPN(giveplayerid)
{
 new name[MAX_PLAYER_NAME];
	GetPlayerName(giveplayerid,name,sizeof(name));
	for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
	if(name[i] == '_') name[i] = ' ';
}
	return name;
}

stock RemoveUnderScore(playerid)
{
 new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
	if(name[i] == '_') name[i] = ' ';
}
	return name;
}
Happened when I added RPN(giveplayerid) stock, anyway to combine them or to remove the warnings?
Reply
#2

Change giveplayerid to something else because giveplayerid is used somewhere else (global).

pawn Код:
stock RPN(playerid)
{
    new name[MAX_PLAYER_NAME], lenght;
    GetPlayerName(playerid,name,sizeof(name));
    lenght = strlen(name);
    for(new i = 0; i < lenght; i++)
    {
        if(name[i] == '_') name[i] = ' ';
    }
    return name;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)