what is this ? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: what is this ? (
/showthread.php?tid=134059)
what is this ? -
MrIncredible - 15.03.2010
Код:
.pwn(1556) : warning 219: local variable "pName" shadows a variable at a preceding level
.pwn(2588) : warning 209: function "OnPlayerDeath" should return a value
.pwn(3893) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
lines 1556, 1557
new pName[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, pName, sizeof(pName));
lines 2585 - 2589
2585- }
return 1;
}
}
2589-
and from 3888 - 3893
stock pName(playerid)
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
return PlayerName;
}
Re: what is this ? -
smeti - 15.03.2010
Not to use variable names doubly!
pawn Код:
new pName2[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName2, sizeof(pName2));
pawn Код:
stock pName(playerid)
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
return PlayerName;
}
Re: what is this ? -
Deat_Itself - 15.03.2010
you defined pName & PlayerName two times ,that s why its giving you this error .Remove new pName[MAX_PLAYER_NAME]; and PlayerName one time from your script