SA-MP Forums Archive
1 warning - 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: 1 warning (/showthread.php?tid=492349)



1 warning - iThePunisher - 03.02.2014

pawn Код:
C:\Users\hacker\Desktop\lscnr script\gamemodes\spree.pwn(120) : warning 219: local variable "Name" shadows a variable at a preceding level
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.


here
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  if(playerid != INVALID_PLAYER_ID && killerid != INVALID_PLAYER_ID)
  {
    new
       Kills,
       string[128];

    Kills = GetPVarInt(killerid, "KillingSpree") + 1;//+1 add murder to the murderer
    SetPVarInt(playerid,"KillingSpree",0);//Kills reset to 0 for the victim
    SetPVarInt(killerid,"KillingSpree",Kills);

    if(Kills == 5)
       format(string,sizeof string,"<< {FF0000}%s(%d) KillingSpree!! with {ffffff}%d {FF0000}Kills",Name(killerid),killerid,Kills);

    else if(Kills == 10)
       format(string,sizeof string,"<< {FF0000}%s(%d) MonsterKill!! with {ffffff}%d {FF0000}Kills",Name(killerid),killerid,Kills);

    else if(Kills == 15)
       format(string,sizeof string,"<< Wow! {FF0000}%s(%d) Unstoppable!! with {ffffff}%d {FF0000}Kills",Name(killerid),killerid,Kills);

    else if(Kills == 20)
       format(string,sizeof string,"<< Amazing! {FF0000}%s(%d) UltraKill!! withn {ffffff}%d {FF0000}Kills",Name(killerid),killerid,Kills);

    else return 1;



Re: 1 warning - dannyk0ed - 03.02.2014

Show us your Name stock.


Re: 1 warning - iThePunisher - 03.02.2014

this is

pawn Код:
stock Name(playerid)
{
    new
        Name[MAX_PLAYER_NAME];

    GetPlayerName(playerid, Name, sizeof(Name));
    return Name;
}



AW: 1 warning - ReD_HunTeR - 03.02.2014

try this

Код:
stock Name(playerid)
{
	new CName[24];
	GetPlayerName(playerid, CName, 24);
 	return CName;
}



Re: 1 warning - iThePunisher - 03.02.2014

ty +rep