#1

I got this error
pawn Код:
C:\Users\gtfytgfy\Desktop\A-RP\gamemodes\A-RP.pwn(27291) : warning 219: local variable "object" shadows a variable at a preceding level
pawn Код:
if(!strcmp(params, "object", true, 5))
    {
        new object;
        if(sscanf(params, "s[128]ii", params, idx, object)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /gedit object [gateid] [objectid]");
        if(!GateInfo[idx][gModel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid gate id.");
        GateInfo[idx][gModel] = object;
        DestroyDynamicObject(GateInfo[idx][gGate]);
        GateInfo[idx][gGate] = CreateDynamicObject(GateInfo[idx][gModel], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]);
        format(string, sizeof(string), " You have set gate ID %d's object ID to %d.", idx, object);
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
Reply
#2

you should change name some of this two..


Код:
if(!strcmp(params, "object", true, 5))
{
      new object;

if(!strcmp(params, "editobject", true, 5))
{
      new objectid;
Reply
#3

That's beacause you've already declared variable 'object' (in global scope probably), you need to change this ones name to something else:
pawn Код:
if(!strcmp(params, "object", true, 5))
    {
        new _gates;
        if(sscanf(params, "s[128]ii", params, idx, _gates)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /gedit object [gateid] [objectid]");
        if(!GateInfo[idx][gModel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid gate id.");
        GateInfo[idx][gModel] = _gates;
        DestroyDynamicObject(GateInfo[idx][gGate]);
        GateInfo[idx][gGate] = CreateDynamicObject(GateInfo[idx][gModel], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]);
        format(string, sizeof(string), " You have set gate ID %d's object ID to %d.", idx, _gates);
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)