Errors Preceding Level
#1

When i put this Script
pawn Код:
forward WireIgnition(playerid, vehicleid);
public WireIgnition(playerid, vehicleid)
{
    new rand = random(7), string[128];
    PlayerInfo[playerid][pJackingCar] =0;
    if(IsPlayerInVehicle(playerid, vehicleid))
    {
        if(rand == 1 || rand == 2) // Successful
        {
            format(string, sizeof(string), "* %s successfully wires the ignition, turning the engine on.", GetPlayerNameEx(playerid));
            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

            new engine,lights,alarm,doors,bonnet,boot,objective;
            GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
            SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);

            SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
            SetTimerEx("SetVehicleEngine", 1000, 0, "dd",  vehicleid, playerid);
        }
        else
        {
            format(string, sizeof(string), "* %s fails to wire the ignition.", GetPlayerNameEx(playerid));
            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
           
            new engine,lights,alarm,doors,bonnet,boot,objective;
            GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
            SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);
        }
    }
    else
    {
        format(string, sizeof(string), "* %s fails to wire the ignition.", GetPlayerNameEx(playerid));
        ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
       
        new engine,lights,alarm,doors,bonnet,boot,objective;
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
        SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);
    }
}
This Warnings Comes, i need to fix this please help,
Код:
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36239) : warning 219: local variable "engine" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36239) : warning 219: local variable "lights" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36239) : warning 219: local variable "alarm" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36239) : warning 219: local variable "doors" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36239) : warning 219: local variable "bonnet" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36239) : warning 219: local variable "boot" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36239) : warning 219: local variable "objective" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36252) : warning 219: local variable "engine" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36252) : warning 219: local variable "lights" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36252) : warning 219: local variable "alarm" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36252) : warning 219: local variable "doors" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36252) : warning 219: local variable "bonnet" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36252) : warning 219: local variable "boot" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36252) : warning 219: local variable "objective" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36263) : warning 219: local variable "engine" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36263) : warning 219: local variable "lights" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36263) : warning 219: local variable "alarm" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36263) : warning 219: local variable "doors" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36263) : warning 219: local variable "bonnet" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36263) : warning 219: local variable "boot" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36263) : warning 219: local variable "objective" shadows a variable at a preceding level
Reply
#2

Try This -

pawn Код:
forward WireIgnition(playerid, vehicleid);
public WireIgnition(playerid, vehicleid)
{
    new engine,lights,alarm,doors,bonnet,boot,objective;
    new rand = random(7), string[128];
    PlayerInfo[playerid][pJackingCar] =0;
    if(IsPlayerInVehicle(playerid, vehicleid))
    {
        if(rand == 1 || rand == 2) // Successful
        {
            format(string, sizeof(string), "* %s successfully wires the ignition, turning the engine on.", GetPlayerNameEx(playerid));
            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

           
            GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
            SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);

            SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
            SetTimerEx("SetVehicleEngine", 1000, 0, "dd",  vehicleid, playerid);
        }
        else
        {
            format(string, sizeof(string), "* %s fails to wire the ignition.", GetPlayerNameEx(playerid));
            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
           
           
            GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
            SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);
        }
    }
    else
    {
        format(string, sizeof(string), "* %s fails to wire the ignition.", GetPlayerNameEx(playerid));
        ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
       
       
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
        SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);
    }
}
Reply
#3

Код:
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36231) : warning 219: local variable "engine" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36231) : warning 219: local variable "lights" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36231) : warning 219: local variable "alarm" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36231) : warning 219: local variable "doors" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36231) : warning 219: local variable "bonnet" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36231) : warning 219: local variable "boot" shadows a variable at a preceding level
C:\Users\pc\Desktop\Servers\SGRP\gamemodes\VGRP.pwn(36231) : warning 219: local variable "objective" shadows a variable at a preceding level
Same Problem
Reply
#4

pawn Код:
forward WireIgnition(playerid, vehicleid);
public WireIgnition(playerid, vehicleid)
{
   
    new rand = random(7), string[128];
    PlayerInfo[playerid][pJackingCar] =0;
    if(IsPlayerInVehicle(playerid, vehicleid))
    {
        if(rand == 1 || rand == 2) // Successful
        {
            format(string, sizeof(string), "* %s successfully wires the ignition, turning the engine on.", GetPlayerNameEx(playerid));
            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

           
            GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
            SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);

            SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
            SetTimerEx("SetVehicleEngine", 1000, 0, "dd",  vehicleid, playerid);
        }
        else
        {
            format(string, sizeof(string), "* %s fails to wire the ignition.", GetPlayerNameEx(playerid));
            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
           
           
            GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
            SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);
        }
    }
    else
    {
        format(string, sizeof(string), "* %s fails to wire the ignition.", GetPlayerNameEx(playerid));
        ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
       
       
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
        SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);
    }
}
Reply
#5

@BroZeus , Thanks
Repped , but how did chu' fixed it?? can you tell me how?? so i know later?
Reply
#6

Код:
local variable "symbolhere" shadows a variable at a preceeding level
this error means that your variable you have created has a similar name to another variable. This can be fixed by changing the name of the variable.
And to all other seniors above who helped,
you should always tell him what he did wrong. just posting scripts is not complete scripting help
Reply
#7

i did by removing this line "new engine,lights,alarm,doors,bonnet,boot,objective;"
because there is one moreline like this on top of your script some where so its cazing this problem because the variable have been defined 2 times
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)