26.04.2014, 18:59
Hey when i compile my script i get fake warnings for example :
Code from 53834 to 53885 :
So, you can notice that the var is used more then 2 times, and it still says that its not used... :/ ?
Quote:
D:\Ahmed\RGRP\gamemodes\RGRP.pwn(53835) : warning 203: symbol is never used: "pl" |
pawn Код:
CMD:sellvip(playerid, params[]) {
new price, string[128], viptype[7], pl;
if(!(1 <= PlayerInfo[playerid][pDonateRank] <= 3)) {
SendClientMessageEx(playerid, COLOR_GREY, "You can only sell Bronze, Silver, and Gold VIP.");
}
else if(PlayerInfo[playerid][pVIPM] == 0) {
SendClientMessageEx(playerid, COLOR_GREY, "You currently don't have a VIP ID assigned. Contact a Shop Tech.");
}
else if(PlayerInfo[playerid][pVIPExpire] - 604800 < gettime()) {
SendClientMessageEx(playerid, COLOR_GREY, "Your VIP expires in less than a week - you can't sell it.");
}
else if(PlayerInfo[playerid][pVIPSold] > gettime()) {
SendClientMessageEx(playerid, COLOR_GREY, "You can only sell your VIP once every two hours.");
}
else {
if(sscanf(params, "ud", pl, price)) {
SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /sellvip [player] [price]");
}
else if(price < 0) {
SendClientMessageEx(playerid, COLOR_GREY, "The price can't be below zero.");
}
else if(pl == playerid) {
SendClientMessageEx(playerid, COLOR_WHITE, "You can't sell VIP to yourself.");
}
else if(!IsPlayerConnected(pl)) {
SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
}
else if(PlayerInfo[pl][pVIPSold] > gettime()) {
SendClientMessageEx(playerid, COLOR_GREY, "That player can only buy VIP once every two hours.");
}
else if (ProxDetectorS(10.0, playerid, pl))
{
switch(PlayerInfo[playerid][pDonateRank])
{
case 1: viptype = "Bronze";
case 2: viptype = "Silver";
case 3: viptype = "Gold";
default: viptype = "Error";
}
SetPVarInt(pl, "VIPSell", playerid);
SetPVarInt(pl, "VIPCost", price);
SetPVarString(pl, "VIPSeller", GetPlayerNameEx(playerid));
format(string, sizeof(string), "Seller: %s\nVIP level: %s \nPrice: %d \nVIP ID: %d\nExpires: %s\n\nDo you wish to purchase %s VIP from %s for $%d?", GetPlayerNameEx(playerid), viptype, price, PlayerInfo[playerid][pVIPM], date(PlayerInfo[playerid][pVIPExpire], 2), viptype, GetPlayerNameEx(playerid), price);
ShowPlayerDialog(pl, SELLVIP, DIALOG_STYLE_MSGBOX, "Purchase VIP", string, "Purchase", "Decline");
format(string, sizeof(string), "You offered %s $%d for your %s VIP.", GetPlayerNameEx(pl), price, viptype);
SendClientMessageEx(playerid, COLOR_WHITE, string);
}
else SendClientMessageEx(playerid, COLOR_GREY, "That player is not near you.");
}
return 1;
}