SA-MP Forums Archive
error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error (/showthread.php?tid=454490)



error - aboa - 29.07.2013

pawn Код:
C:\Users\gtfytgfy\Desktop\LSS-RP\gamemodes\LSS-RP.pwn(27444) : warning 219: local variable "object" shadows a variable at a preceding level
pawn Код:
CMD:creategate(playerid, params[])
{
    new string[128], object;
    if(gPlayerSpawned[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   You are not logged in or have not spawned !");
        return 1;
    }
    if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(sscanf(params, "i", object)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /creategate [objectid]");
    for(new idx=1; idx<MAX_GATES; idx++)
    {
        if(!GateInfo[idx][gModel])
        {
            GetPlayerPos(playerid, GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ]);
            GateInfo[idx][gModel] = object;
            GateInfo[idx][gCX] = GateInfo[idx][gCX] + 2;
            GateInfo[idx][gCY] = GateInfo[idx][gCY] + 2;
            GateInfo[idx][gCRX] = 0;
            GateInfo[idx][gCRY] = 0;
            GateInfo[idx][gCRZ] = 0;
            GetPlayerPos(playerid, GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ]);
            GateInfo[idx][gOX] = GateInfo[idx][gOX] + 2;
            GateInfo[idx][gOY] = GateInfo[idx][gOY] + 2;
            GateInfo[idx][gORX] = 0;
            GateInfo[idx][gORY] = 0;
            GateInfo[idx][gORZ] = 0;
            GateInfo[idx][gStatus] = 0;
            format(GateInfo[idx][gPassword], 256, "");
            GateInfo[idx][gSpeed] = 2;
            // Creating
            format(string, sizeof(string), "Gate ID: %d", idx);
            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]);
            GateInfo[idx][gText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], 10);
            // Text
            format(string, sizeof(string), "AdmWarn: %s has created gate ID %d. (Object: %d)", RPN(playerid), idx, object);
            SendAdminMessage(COLOR_DARKRED, string);
            idx = MAX_GATES;
        }
    }
    return 1;
}



Re: error - aboa - 29.07.2013

any help??


Re: error - San1 - 29.07.2013

Show us Line 27444