warning help
#1

pawn Код:
C:\Documents and Settings\james\Desktop\Titanium Roleplay GM\Titanium Roleplay v1.0\gamemodes\test.pwn(269) : warning 219: local variable "Name" shadows a variable at a preceding level
pawn Код:
stock PlayerName(playerid)
{
    new Name[MAX_PLAYER_NAME + 1];
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME + 1);
    return Name;
}
can anyone help please?

Thanks
Reply
#2

You have another global variable in your script called "Name" (check on top of your script)
and so the easy fix would be to change one of them.
Reply
#3

You have already defined the array/string Name globally, so either delete that global array or, replace thestock with the following and it should go away.
pawn Код:
stock PlayerName(playerid)
{
    new PName[MAX_PLAYER_NAME + 1];
    GetPlayerName(playerid, PName, MAX_PLAYER_NAME + 1);
    return PName;
}
EDIT: Too late
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)