warning 219: local variable "name" shadows a variable at a preceding level -
Team_PRO - 27.09.2014
Код:
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(239) : error 017: undefined symbol "CreateDynamicCP"
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(239) : error 033: array must be indexed (variable "Checkp")
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(240) : error 017: undefined symbol "CreateDynamicCP"
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(240) : error 033: array must be indexed (variable "Checkp")
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(241) : error 017: undefined symbol "CreateDynamicCP"
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(241) : error 033: array must be indexed (variable "Checkp")
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(242) : error 017: undefined symbol "CreateDynamicCP"
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(242) : error 033: array must be indexed (variable "Checkp")
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(243) : error 017: undefined symbol "CreateDynamicCP"
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(243) : error 033: array must be indexed (variable "Checkp")
pawn Код:
Checkp = CreateDynamicCP(217.3311,1421.1808,10.5859);
Checkp = CreateDynamicCP(-34.0133,2347.8242,24.1406);
Checkp = CreateDynamicCP(586.7196,874.7552,-42.4973);
Checkp = CreateDynamicCP(-321.0843,1791.6788,42.7813);
Checkp = CreateDynamicCP(-254.6677,2602.1467,62.8582);
pawn Код:
new Checkp[MAX_CHECK_POINTS];
Код:
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(446) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(446) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(448) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(448) : warning 215: expression has no effect
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(448) : error 001: expected token: ";", but found ")"
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(448) : error 029: invalid expression, assumed zero
C:\Users\Matt\Desktop\SA-MP Files\Team.pwn(448) : fatal error 107: too many error messages on one line
pawn Код:
new string[128], name[24];
SetTimerEx("Autorepair",500,true,"d",playerid);
if(fexist(UserPath(playerid)))
Re: warning 219: local variable "name" shadows a variable at a preceding level -
Sawalha - 27.09.2014
First one, you missed that you have an array, which includes
so it would be:
pawn Код:
Checkp[ID OF CHECKPOINT] = etc...
Second one, you have used variable called "name" twice in same function, so change it to name2 as an example
Re: warning 219: local variable "name" shadows a variable at a preceding level -
Team_PRO - 27.09.2014
one thing also what is this?
Код:
C:\Users\Matt\Desktop\SA-MP Files\pawno\include\YSI\..\YSI_Visual\..\YSI_Data\y_iterate.inc(235) : fatal error 111: user error: Old foreach.inc files are no longer compatible with YSI.
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: warning 219: local variable "name" shadows a variable at a preceding level -
biker122 - 27.09.2014
pawn Код:
new Checkp[5];
Checkp[0] = CreateDynamicCP(217.3311,1421.1808,10.5859);
Checkp[1] = CreateDynamicCP(-34.0133,2347.8242,24.1406);
Checkp[2] = CreateDynamicCP(586.7196,874.7552,-42.4973);
Checkp[3]= CreateDynamicCP(-321.0843,1791.6788,42.7813);
Checkp[4] = CreateDynamicCP(-254.6677,2602.1467,62.8582);
EDIT: Update foreach.
Re: warning 219: local variable "name" shadows a variable at a preceding level -
Sawalha - 27.09.2014
I think you should get the last version of foreach, be cause it's not "compatible" with the newer version of YSI.
Re: warning 219: local variable "name" shadows a variable at a preceding level -
IceBilizard - 27.09.2014
and for
errors
use
Edit:
Correct native of CreateDynamicCP
pawn Код:
native CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
Re: warning 219: local variable "name" shadows a variable at a preceding level -
Team_PRO - 27.09.2014
Код:
C:\Users\Matt\Desktop\bare.pwn(3024) : warning 225: unreachable code
C:\Users\Matt\Desktop\bare.pwn(3028) : error 017: undefined symbol "playerid"
C:\Users\Matt\Desktop\bare.pwn(3031) : error 017: undefined symbol "playerid"
C:\Users\Matt\Desktop\bare.pwn(3032) : error 079: inconsistent return types (array & non-array)
C:\Users\Matt\Desktop\bare.pwn(3034) : warning 225: unreachable code
C:\Users\Matt\Desktop\bare.pwn(3034) : error 017: undefined symbol "playerid"
C:\Users\Matt\Desktop\bare.pwn(3035) : error 017: undefined symbol "playerid"
C:\Users\Matt\Desktop\bare.pwn(3036) : error 079: inconsistent return types (array & non-array)
C:\Users\Matt\Desktop\bare.pwn(3039) : error 017: undefined symbol "text"
C:\Users\Matt\Desktop\bare.pwn(3039) : error 017: undefined symbol "playerid"
C:\Users\Matt\Desktop\bare.pwn(3039) : error 079: inconsistent return types (array & non-array)
C:\Users\Matt\Desktop\bare.pwn(3039) : fatal error 107: too many error messages on one line
pawn Код:
stock Name(id)
{
new name[25];
GetPlayerName(id, name, 24);
return name;
{
new rand = random(sizeof(RandomSpawn));
// SetPlayerPos to the random spawn data
SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
// SetPlayerFacingAngle to the random facing angle data
SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
return 1;
}
if(P_Data[playerid][pMute] == 1) {
SCM(playerid, COLOR_RED, "You are muted, noone can hear you!");
return 0; }
for(new words; words<sizeof(SwearWords); words++)
{
if(strfind(text,SwearWords[words],true) != -1 ) { SCM(playerid, COLOR_RED,"You can not swear"); return 0;}
}
P_Data[playerid][pSpam] += 1;
if(P_Data[playerid][pSpam] == 5) {
new string[128];
format(string, 128, "[Anti-Spam] Player %s has been kicked.", GetName(playerid));
SCMToAll(COLOR_RED,string);
Kick(playerid);
}
else if(P_Data[playerid][pSpam] == 4) {
SCM(playerid,COLOR_RED,"Stop with spam or you will be kicked!");
return 0;
}
return 1;
}
Re: warning 219: local variable "name" shadows a variable at a preceding level -
IceBilizard - 27.09.2014
try this
pawn Код:
stock Name(playerid)
{
new name[25];
GetPlayerName(playerid, name, 24);
return name;
new rand = random(sizeof(RandomSpawn));
SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
if(P_Data[playerid][pMute] == 1)
{
SCM(playerid, COLOR_RED, "You are muted, noone can hear you!");
return 0;
}
for(new words; words<sizeof(SwearWords); words++)
{
if(strfind(text,SwearWords[words],true) != -1 ) { SCM(playerid, COLOR_RED,"You can not swear"); return 0;}
}
P_Data[playerid][pSpam] += 1;
if(P_Data[playerid][pSpam] == 5)
{
new string[128];
format(string, 128, "[Anti-Spam] Player %s has been kicked.", GetName(playerid));
SCMToAll(COLOR_RED,string);
Kick(playerid);
}
else if(P_Data[playerid][pSpam] == 4)
{
SCM(playerid,COLOR_RED,"Stop with spam or you will be kicked!");
return 0;
}
return 1;
}
Re: warning 219: local variable "name" shadows a variable at a preceding level -
Team_PRO - 27.09.2014
and how to make captureable zones?
Re: warning 219: local variable "name" shadows a variable at a preceding level -
KayJ - 27.09.2014
Quote:
Originally Posted by Team_PRO
and how to make captureable zones?
|
https://sampforum.blast.hk/showthread.php?tid=353267