weaponconfig.inc error
#1

When I compile it gives me these errors
Код:
weaponconfig.inc(3123) : warning 219: local variable "err" shadows a variable at a preceding level
weaponconfig.inc(3370) : warning 219: local variable "err" shadows a variable at a preceding level
Also I don't have such a var called 'err' in my script

I don't have idea what to do please help me
Reply
#2

The variable is inside the weaponconfig.inc file.
Reply
#3

Ye I know, I mean normally this kind of warning comes if the var is used on both scripts(inc & gm)

BTW don't you have any solution?
Reply
#4

Can you load this inc in pastebin and show it to us?

You can simply rename the variable in the include or in the gm
Reply
#5

All the files that you include in your gamemode eventually become part of that gamemode, so you need to look inside all the files that you've included as well, not just your gamemode itself.
Reply
#6

Thanks but is there any other easier way

somewhat like changing the include order

my include order for now
Код:
#include <a_samp>
#include <progress2>
#include <YSI\y_ini>
#include <streamer>
#include <weaponconfig>
#include <zcmd>
#include <foreach>
#include <sscanf2>
#include <YSI\y_va>
#include <easydb>
#include <playerzone>
Reply
#7

The order in which includes are arranged won't affect how global variables conflict with each other. If I swap 'new err;' on line 3 with 'new err;' on line 5, I'm still going to have two variables with the same name on line 3 and 5.. swapping them won't do anything. You need to search the includes for the conflicting error and make them static or change the name.
Reply
#8

Thanks I'll do that
also I have another question I made a gang system. every thing there is works fine but /gang skin <id> is not working I don't know why when I type /gang skin even usage is not showing my command is this
Код:
CMD:gang (playerid, params[])
{
    new id, skin, fstr[128], str[128], gstr[128];
    if(sscanf(params, "s[30]", gstr)) return SendClientMessage(playerid, COLOR_ERROR, "Usage: /gang  <...> ");
    if(strcmp(gstr, "skin", true) == 0)
    {
        if(GANGINFO[playerid][ingang] == false) return SendClientMessage(playerid, COLOR_ERROR, "You are not in a gang");
        if(GetPlayerMoney(playerid) < MIN_CASH_TO_CHANGE_SKIN) return SendClientMessage(playerid, COLOR_ERROR, "You don't have enough money");
        if(sscanf(params, "i", skin)) return SendClientMessage(playerid, -1, "Usage: /gang skin <id>");
        if(skin > 299 || skin < 0) return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
        switch(skin)
        {
            case 105: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 106: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 107: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 270: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 269: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 271: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 114: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 115: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 116: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 41: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 265: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 266: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 267: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 284: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 286: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 285: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 102: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 103: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 104: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 85: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 108: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 109: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 110: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 63: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 55: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 117: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 163: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 164: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
            case 165: return SendClientMessage(playerid, COLOR_ERROR, "Invalid skin ID");
        }
        GANGINFO[playerid][gskin] = skin;
        SetPlayerSkin(playerid, skin);
    }
return 1;
}
Reply
#9

Try this and see if this has any effect:
PHP код:
CMD:gang(playeridparams[])
{
    new 
paraminteger;
    if(!
sscanf(params"'skin'I(-1)"paraminteger))
    {
        if(
paraminteger == -1) return SendClientMessage(playerid, -1"Usage: /gang skin <id>");
        if(!
GANGINFO[playerid][ingang]) return SendClientMessage(playeridCOLOR_ERROR"You are not in a gang");
        if(
GetPlayerMoney(playerid) < MIN_CASH_TO_CHANGE_SKIN) return SendClientMessage(playeridCOLOR_ERROR"You don't have enough money");
        switch(
paraminteger)
        {
            case 
41556385102 .. 110114 .. 117163 .. 165265 .. 267269 .. 271284 .. 286: return SendClientMessage(playeridCOLOR_ERROR"Invalid skin ID");
            default:
            {
                if(!(
<= paraminteger <= 299)) return SendClientMessage(playeridCOLOR_ERROR"Invalid skin ID");
                
GANGINFO[playerid][gskin] = paraminteger;
                
SetPlayerSkin(playeridparaminteger);
            }
        }
    }
    else 
SendClientMessage(playeridCOLOR_ERROR"Usage: /gang  <...> ");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)