27.06.2014, 07:27
Код:
(76406) : warning 219: local variable "GiftCode" shadows a variable at a preceding level : error 017: undefined symbol "Vip" : error 017: undefined symbol "Vip" : error 017: undefined symbol "Time" : error 017: undefined symbol "VipToken" : error 017: undefined symbol "Vip" : error 017: undefined symbol "Money" : error 017: undefined symbol "Money" : error 017: undefined symbol "Vcoin" : error 017: undefined symbol "Vcoin" : warning 203: symbol is never used: "szResult" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 10 Errors.
This is my code:
Код:
CMD:giftcode(playerid, params[])
{
if(PlayerInfo[playerid][pLevel] >= 3)
{
new query[256], GiftCode[32];
if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /giftcode <code>");
mysql_real_escape_string(params, GiftCode, MainPipeline);
format(query, sizeof(query), "SELECT `TinhTrang`, `VIP`, `Time`, `VipToken`, `Money`, `Vcoin` FROM `giftcodegaming` WHERE `Giftcode`='%s' AND `SuDung` = 0 ", GiftCode);
mysql_function_query(MainPipeline, query, true, "GiftCodeGaming", "i", playerid);
format(query, sizeof(query), "UPDATE `giftcodegaming` SET `SuDung`=1, `NguoiDung`='%s' WHERE `GiftCode`='%s' AND `SuDung`=0", GetPlayerNameEx(playerid), GiftCode);
mysql_function_query(MainPipeline, query, false, "GiftCodeGaming", "i", playerid);
return 1;
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "Ban can it nhat Level 3!");
return 1;
}
}
return 1;
}
forward GiftCodeGaming(index);
public GiftCodeGaming(index)
{
if(IsPlayerConnected(index))
{
new TinhTrang;
new rows, fields, szResult;
cache_get_data(rows, fields, MainPipeline);
if(rows)
{
if(TinhTrang == 1)
{
new vip[10], time[10], viptoken[10], money[10], vcoin[10];
cache_get_field_content(rows, "VIP", vip);
cache_get_field_content(rows, "Time", time);
cache_get_field_content(rows, "VipToken", viptoken);
cache_get_field_content(rows, "Money", money);
cache_get_field_content(rows, "Vcoin", vcoin);
if(Vip > 0 && Time > 0)
{
PlayerInfo[index][pDonateRank] = Vip;
PlayerInfo[index][pTempVIP] = 0;
PlayerInfo[index][pBuddyInvited] = 0;
PlayerInfo[index][pVIPExpire] = gettime()+3600*Time;
}
if(VipToken > 0)
{
PlayerInfo[index][pTokens] = Vip;
}
if(Money > 0)
{
GivePlayerCash(index, Money);
}
if(Vcoin >0)
{
PlayerInfo[index][pVcoin] = Vcoin;
}
SendClientMessageEx(index, COLOR_WHITE, "GiftCode da Su Dung Thanh Cong, Qua tang da duoc trao");
}
else {
SendClientMessageEx(index, COLOR_WHITE, "GiftCode cua ban chua duoc Kich Hoat");
return 1;
}
}
else
{
SendClientMessageEx(index, COLOR_WHITE, "GiftCode cua ban khong chinh xac hoac da duoc su dung");
}
}
return 1;
}


