Warnings. I cant find a way to fix it.
#1

These are the warnings.
Код:
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
Lines 2081-2099:
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;
}
Above this code it's lines 1942-2080:
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;
    }
P.S: The "new numitems;" is above "if(total != 0) {" , I don't know why it shows it like this.







.
Reply
#2

Maintain your scripting format or write this in top of your gamemode
pawn Код:
#pragma tabsize 0
Reply
#3

Quote:
Originally Posted by Rittik
Посмотреть сообщение
Maintain your scripting format or write this in top of your gamemode
pawn Код:
#pragma tabsize 0
Same warnings come up.
Reply
#4

That code should be added below the includes ,I guess.
Reply
#5

in·den·ta·tion
ˌindenˈtāSHən/Submit
noun
1.
the action of indenting or the state of being indented.
"paragraphs are marked off by indentation"
2.
a deep recess or notch on the edge or surface of something.
"the indentation between the upper lip and the nose"
(Credit to ******)

Basically, your indentations/formatting is off. To fix this, you just need to make sure you indent properly and these warnings should be gone.
Reply
#6

you are use WC-RP script you can never fixed that WCRP is released!
Reply
#7

make sure you place your brackets correctly.
Reply
#8

Quote:
Originally Posted by Barnwell
Посмотреть сообщение
you are use WC-RP script you can never fixed that WCRP is released!
Basically these re the warnings left after the other 179 I had, and also I won't use this script. My friend gave it to me to try to fix it.
As I see you use the WC-RP script on your server xD :3
__________________________________________________ ____
****** what do you mean? I tried everything but didn't work.
I also read this thread but it didn't help. https://sampforum.blast.hk/showthread.php?tid=256961



.
Reply
#9

Quote:
Originally Posted by ******
Посмотреть сообщение
I suspect the problem is all those huge macros - just use normal functions.
I'll try but If I won't fix it, does it damage the gamemode? And these lines won't function in the server?
Reply
#10

Quote:
Originally Posted by Rittik
Посмотреть сообщение
Maintain your scripting format or write this in top of your gamemode
pawn Код:
#pragma tabsize 0
Never fucking use #pragma, that's one extra line of code that doesn't need to be there. Learn to indent for crying out loud! It's not that hard.

pawn Код:
Something
{
    oooh something here
    {
          omg
    }
}
It's not hard, honestly isn't.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)