09.11.2012, 08:36
Hy when i compile the gamemode:I get this error:
warning 219: local variable "i" shadows a variable at a preceding level
warning 219: local variable "i" shadows a variable at a preceding level
Код:
CMD:destroyboombox(playerid, params[])
{
if(GetPVarType(playerid, "pBoomBox"))
{
DestroyDynamicObject(GetPVarInt(playerid, "pBoomBox"));
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "pBoomBoxLabel"));
DeletePVar(playerid, "pBoomBox"); DeletePVar(playerid, "pBoomBoxStation"); DeletePVar(playerid, "pBoomBoxLabel");
DeletePVar(playerid, "pBoomBoxX"); DeletePVar(playerid, "pBoomBoxY"); DeletePVar(playerid, "pBoomBoxZ");
if(GetPVarType(playerid, "pBoomBoxArea"))
{
new string[128];
format(string, sizeof(string), "* %s has destroyed the boombox.", GetPlayerNameEx(playerid));
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "pBoomBoxArea")))
{
StopAudioStreamForPlayer(playerid);
SendClientMessage(i, COLOR_PURPLE, string);
}
}
DeletePVar(playerid, "pBoomBoxArea");
}
SendClientMessage(playerid, COLOR_WHITE, "You've destroyed your boombox!");
}
else
{
foreach(Player, i)
{
if(GetPVarType(i, "pBoomBox"))
{
if(GetPVarInt(i, "pBoomBoxVW") == GetPlayerVirtualWorld(playerid) && GetPVarInt(i, "pBoomBoxInt") == GetPlayerInterior(playerid) && IsPlayerInRangeOfPoint(playerid, 5.0, GetPVarFloat(i, "pBoomBoxX"), GetPVarFloat(i, "pBoomBoxY"), GetPVarFloat(i, "pBoomBoxZ")))
{
DestroyDynamicObject(GetPVarInt(i, "pBoomBox"));
DestroyDynamic3DTextLabel(Text3D:GetPVarInt(i, "pBoomBoxLabel"));
DeletePVar(i, "pBoomBox");
DeletePVar(i, "pBoomBoxStation");
DeletePVar(i, "pBoomBoxLabel");
DeletePVar(i, "pBoomBoxX");
DeletePVar(i, "pBoomBoxY");
DeletePVar(i, "pBoomBoxZ");
DeletePVar(i, "pBoomBoxInt");
DeletePVar(i, "pBoomBoxVW");
new string[128];
if(GetPVarType(i, "pBoomBoxArea"))
{
format(string, sizeof(string), "* %s has destroyed the boombox.", GetPlayerNameEx(playerid));
foreach(Player, i)
{
if(IsPlayerInDynamicArea(playerid, GetPVarInt(i, "pBoomBoxArea")))
{
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, COLOR_PURPLE, string);
}
}
DeletePVar(i, "pBoomBoxArea");
}
format(string, sizeof(string), "%s has destroyed your boombox!", GetPlayerNameEx(playerid));
SendClientMessage(i, COLOR_WHITE, string);
return 1;
}
}
}
SendClientMessage(playerid, COLOR_WHITE, "You don't have a boombox or you are not near one to destroy.");
}
return 1;
}


