SA-MP Forums Archive
Smail [Help] +Rep - 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)
+--- Thread: Smail [Help] +Rep (/showthread.php?tid=552348)



Smail [Help] +Rep - astanalol - 24.12.2014

Hello All
i Get This Error
Quote:

D:\ffff\gamemodes\textdraw.pwn(482) : warning 219: local variable "GetName" shadows a variable at a preceding level

PHP Code:
stock GetName(playerid)
{
     new 
GetName[MAX_PLAYER_NAME];
     
GetPlayerName(playeridGetNamesizeof(GetName));
     return 
GetName;




Re: Smail [Help] +Rep - Kimossab - 24.12.2014

you can't declare a variable with the same name of a function. so instead of new GetName write new Name


Re: Smail [Help] +Rep - astanalol - 24.12.2014

Quote:
Originally Posted by Kimossab
View Post
you can't declare a variable with the same name of a function. so instead of new GetName write new Name
i will make new name and write it in my commands!


Re: Smail [Help] +Rep - astanalol - 24.12.2014

Help Please!


Re : Smail [Help] +Rep - StreetRP - 24.12.2014

Remplace with is
PHP Code:
stock GetName(playerid)
{
    new 
plName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplNamesizeof(plName));
    return 
plName;




Re: Smail [Help] +Rep - virusa1 - 24.12.2014

Code:
stock GetName(playerid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	return name;
}