16.06.2014, 12:45
These are the warnings.
Lines 2081-2099:
Above this code it's lines 1942-2080:
P.S: The "new numitems;" is above "if(total != 0) {" , I don't know why it shows it like this.
.
Код:
f\business.pwn(2083) : warning 217: loose indentation f\business.pwn(2084) : warning 217: loose indentation f\business.pwn(2085) : warning 217: loose indentation f\business.pwn(2086) : warning 217: loose indentation f\business.pwn(2087) : warning 217: loose indentation f\business.pwn(2178) : warning 217: loose indentation
pawn Код:
new numitems;
if(total != 0) {
CheckNumberedItem("Vehicle Lock Picks","VehLockpicks")
CheckNumberedItem("Vehicle Tracer","VehTracers")
CheckNumberedItem("Cigars","Cigars")
CheckNumberedItem("Fertilizer","NumFertilizer")
CheckNumberedItem("Gas Can","GasCans")
format(tempstr,sizeof(tempstr),"Congratulations, you now own %s %s",getNumberString(numitems) ,Buyable24Items[itemid][EBIDisplayName]);
} else {
format(tempstr,sizeof(tempstr),"Congratulations, you now own a %s",Buyable24Items[itemid][EBIDisplayName]);
}
addToBusinessTill(biz, floatround(Buyable24Items[itemid][EBIPrice]/2));
SendClientMessage(playerid, X11_GREEN2, tempstr);
SetPVarInt(playerid, "UserFlags", flags);
#undef CheckNumberedItem
#undef CheckItemInt
#undef CheckItem
return 0;
}
pawn Код:
public On247ItemBuy(playerid, itemid, biz, total) {
new flags = GetPVarInt(playerid, "UserFlags");
if(Buyable24Items[itemid][EBIType] != EType_NumSelect) {
if(Buyable24Items[itemid][EBIPrice] > GetMoneyEx(playerid)) {
SendClientMessage(playerid, X11_RED3, "You don't have enough cash");
return 0;
}
}
#define CheckItem(%1,%2) if(!strcmp(Buyable24Items[itemid][EBIDisplayName],%1)) { \
if(~flags & %2) { \
flags |= %2; \
GiveMoneyEx(playerid, -Buyable24Items[itemid][EBIPrice]); \
} else { \
format(tempstr, sizeof(tempstr),"You already have a %s",Buyable24Items[itemid][EBIDisplayName]); \
SendClientMessage(playerid, X11_GREEN2, tempstr); \
return 1;\
} \
}
#define CheckItemInt(%1,%2) if(!strcmp(Buyable24Items[itemid][EBIDisplayName],%1)) { \
if(GetPVarInt(playerid, %2) == 0) { \
SetPVarInt(playerid, %2, 1); \
GiveMoneyEx(playerid, -Buyable24Items[itemid][EBIPrice]); \
} else { \
format(tempstr, sizeof(tempstr),"You already have a %s",Buyable24Items[itemid][EBIDisplayName]); \
SendClientMessage(playerid, X11_GREEN2, tempstr); \
return 1;\
} \
}
#define CheckNumberedItem(%1,%2)\
if(!strcmp(Buyable24Items[itemid][EBIDisplayName],%1)) { \
if(floatround(Buyable24Items[itemid][EBIPrice]*total) > GetMoneyEx(playerid)) { \
SendClientMessage(playerid, X11_RED3, "You don't have enough cash"); \
return 0; \
} \
GiveMoneyEx(playerid, floatround(-Buyable24Items[itemid][EBIPrice]*total)); \
numitems = GetPVarInt(playerid, %2)+total; \
SetPVarInt(playerid,%2,numitems); \
}
CheckItem("GPS",EUFHasGPS)
CheckItem("Dice",EUFHasDice)
CheckItem("MP3 Player", EUFHasMP3Player)
CheckItem("Walkie Talkie",EUFHasWalkieTalkie)
CheckItem("Phone Book",EUFHasPhoneBook)
CheckItemInt("Cell Phone", "phone")
if(!strcmp(Buyable24Items[itemid][EBIDisplayName],"Mask")) {
if(GetPVarInt(playerid, "ConnectTime") < 60 || GetPVarInt(playerid, "Level") < 3) {
SendClientMessage(playerid, X11_TOMATO_2, "You need 60 playing hours and level 3 to use this!");
return 1;
}
if(~flags & EUFHasMask) {
flags |= EUFHasMask;
GiveMoneyEx(playerid, -Buyable24Items[itemid][EBIPrice]);
} else {
format(tempstr, sizeof(tempstr),"You already have a %s",Buyable24Items[itemid][EBIDisplayName]);
SendClientMessage(playerid, X11_GREEN2, tempstr);
return 1;
}
}
if(!strcmp(Buyable24Items[itemid][EBIDisplayName],"Camera")) {
new weapon, ammo;
GetPlayerWeaponDataEx(playerid, 9, weapon, ammo);
if(weapon != 43 && weapon != 0) {
SendClientMessage(playerid, X11_TOMATO_2, "You are currently holding a weapon in that slot, you cannot use this.");
return 1;
}
GivePlayerWeaponEx(playerid, 43, -1);
GiveMoneyEx(playerid, -Buyable24Items[itemid][EBIPrice]);
return 1;
}
if(!strcmp(Buyable24Items[itemid][EBIDisplayName],"Shovel")) {
new weapon, ammo;
GetPlayerWeaponDataEx(playerid, 1, weapon, ammo);
if(weapon != 6 && weapon != 0) {
SendClientMessage(playerid, X11_TOMATO_2, "You are currently holding a weapon in that slot, you cannot use this.");
return 1;
}
GivePlayerWeaponEx(playerid, 6, -1);
GiveMoneyEx(playerid, -Buyable24Items[itemid][EBIPrice]);
return 1;
}
if(!strcmp(Buyable24Items[itemid][EBIDisplayName],"Flowers")) {
new weapon, ammo;
GetPlayerWeaponDataEx(playerid, 10, weapon, ammo);
if(weapon != 14 && weapon != 0) {
SendClientMessage(playerid, X11_TOMATO_2, "You are currently holding a weapon in that slot, you cannot use this.");
return 1;
}
GivePlayerWeaponEx(playerid, 14, -1);
GiveMoneyEx(playerid, -Buyable24Items[itemid][EBIPrice]);
return 1;
}
if(!strcmp(Buyable24Items[itemid][EBIDisplayName],"Pool Cue")) {
new weapon, ammo;
GetPlayerWeaponDataEx(playerid, 1, weapon, ammo);
if(weapon != 7 && weapon != 0) {
SendClientMessage(playerid, X11_TOMATO_2, "You are currently holding a weapon in that slot, you cannot use this.");
return 1;
}
GivePlayerWeaponEx(playerid, 7, -1);
GiveMoneyEx(playerid, -Buyable24Items[itemid][EBIPrice]);
return 1;
}
if(!strcmp(Buyable24Items[itemid][EBIDisplayName],"Golf Club")) {
new weapon, ammo;
GetPlayerWeaponDataEx(playerid, 1, weapon, ammo);
if(weapon != 2 && weapon != 0) {
SendClientMessage(playerid, X11_TOMATO_2, "You are currently holding a weapon in that slot, you cannot use this.");
return 1;
}
GivePlayerWeaponEx(playerid, 2, -1);
GiveMoneyEx(playerid, -Buyable24Items[itemid][EBIPrice]);
return 1;
}
if(!strcmp(Buyable24Items[itemid][EBIDisplayName],"Cane")) {
new weapon, ammo;
GetPlayerWeaponDataEx(playerid, 10, weapon, ammo);
if(weapon != 15 && weapon != 0) {
SendClientMessage(playerid, X11_TOMATO_2, "You are currently holding a weapon in that slot, you cannot use this.");
return 1;
}
GivePlayerWeaponEx(playerid, 15, -1);
GiveMoneyEx(playerid, -Buyable24Items[itemid][EBIPrice]);
return 1;
}
if(!strcmp(Buyable24Items[itemid][EBIDisplayName],"Spray Can")) {
new weapon, ammo;
GetPlayerWeaponDataEx(playerid, 10, weapon, ammo);
if(weapon != 41 && weapon != 0) {
SendClientMessage(playerid, X11_TOMATO_2, "You are currently holding a weapon in that slot, you cannot use this.");
return 1;
}
GivePlayerWeaponEx(playerid, 41, -1);
GiveMoneyEx(playerid, -Buyable24Items[itemid][EBIPrice]);
return 1;
}
.