D:\my mod\gamemodes\LSTDM.pwn(1132) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.
вот код комманды которою я вшил:)))
[pwn]
if (strcmp(cmd,"/gweapon", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, " ПРАВКА: /gweapon [id игрока] [id оружия или название] [патроны]");
new player1 = strval(tmp), weap, ammo, WeapName[32], string[128];
if(!strlen(tmp3) || !IsNumeric(tmp3) || strval(tmp3) <= 0 || strval(tmp3) > 99999) ammo = 500; else ammo = strval(tmp3);
if(!IsNumeric(tmp2)) weap = GetWeaponIDFromName(tmp2); else weap = strval(tmp2);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
if(!IsValidWeapon(weap)) return SendClientMessage(playerid,COLOR_RED," ОШИБКА: Неверный ID оружия");
GetWeaponName(weap,WeapName,32);
format(string, sizeof(string), " Вы дали игроку %s оружие %s(ID:%d) с %d патронами", PlayerName2(player1), WeapName, weap, ammo); SendClientMessage(playerid,COLOR_GREEN,string);
if(player1 != playerid)
{
format(string,sizeof(string)," Админ %s дал вам оружие %s(ID:%d) с %d патронами", PlayerName2(playerid), WeapName, weap, ammo); SendClientMessage(player1,COLOR_GREEN,string);
}
return GivePlayerWeapon(player1, weap, ammo);
}
else return SendClientMessage(playerid,COLOR_RED," ОШИБКА: Нет такого игрока");
}
else return SendClientMessage(playerid,COLOR_RED," ОШИБКА: Ты не админ!");
}
[/pwn]
достали варнинги:

Добавлено (11.01.2009, 13:42)
---------------------------------------------
_____
почему две темы создалось???