[HELP] Shadows a variable at a preceding level
#1

I don;t understund why give me these warnings ()



Код:
warning 219: local variable "engine" shadows a variable at a preceding level
warning 219: local variable "lights" shadows a variable at a preceding level
warning 219: local variable "alarm" shadows a variable at a preceding level
warning 219: local variable "doors" shadows a variable at a preceding level
warning 219: local variable "bonnet" shadows a variable at a preceding level
warning 219: local variable "boot" shadows a variable at a preceding level
warning 219: local variable "objective" shadows a variable at a preceding level
pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        if(newkeys == KEY_LOOK_BEHIND)//if(KeyPressed(KEY_LOOK_BEHIND))
        {
            SetVehicleParamsEx(vehicleid, !engine, lights, alarm, doors, bonnet, boot, objective);
            if(!engine) GameTextForPlayer(playerid, "~w~MOTOR : ~g~PORNIT", 4000, 3);
            else GameTextForPlayer(playerid, "~w~MOTOR : ~r~OPRIT", 4000, 3);
        }
        if(newkeys == KEY_ANALOG_UP)//if(KeyPressed(KEY_NO))
        {
            SetVehicleParamsEx(vehicleid, engine, !lights, alarm, doors, bonnet, boot, objective);
            if(!lights) GameTextForPlayer(playerid, "~w~FARURI : ~g~APRINSE", 3000, 3);
            else GameTextForPlayer(playerid, "~w~FARURI : ~r~OPRITE", 3000, 3);
        }
    }
new vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective; - is the line
Reply
#2

All those variables were created before, just rename.
Reply
#3

That could either mean they're already defined in the command, or you've defined them globally.
Removing them should be fine, otherwise you can just rename them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)