[HELP] State Warning
#1

Mergin a filterscript into the Gamemode
Here's the code:

pawn Код:
new cartype = GetPlayerVehicleID(playerid);
pawn Код:
new State=GetPlayerState(playerid);
pawn Код:
if(strcmp(cmdtext, "/neonshop", true) == 0)
        {

        SetPlayerInterior(playerid,0);
        {if(State!=PLAYER_STATE_DRIVER)
        {SetPlayerPos(playerid,-1980.0026,474.2643,29);}
        else if(IsPlayerInVehicle(playerid, cartype) == 1)
        {SetVehiclePos(cartype,-1980.0026,474.2643,29);
        SetVehicleZAngle(cartype,180.1530);}
        else
        {SetPlayerPos(playerid,-1980.0026,474.2643,29);}
        SendClientMessage(playerid, COLOR_YELLOW,"Type /neon in the garage to pick a neon!");}

        return 1;}

    if (strcmp(cmdtext, "/neon", true)==0)
    {
     if(IsPlayerInRangeOfPoint(playerid, 7.0, -1979.3672,440.1091,27))
    {

    ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_LIST, "Pick Neon Color", "Blue\nRed\nGreen\nWhite\nPink\nYellow\nPolice Strobe\nInterior Lights\nBack Neon\nFront neon\nUndercover Roof Light\nRemove All Neon", "Select", "Cancel");
    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
}
return 1;
}
i dont know iff its because its already defined i already have #pragma tabsize 0 in there.
keep gettin this error:

pawn Код:
warning 219: local variable "State" shadows a variable at a preceding level
Please some help here
Reply
#2

1. Remove #pragma tabsize 0, you don't need It.
2. "Shadows a variable at a preceding level" means that you have defined something twice.

Example;
pawn Код:
new variable[12];
new variable[12];
will give you that, but also If the second "new variable[12];" is further down it will tell you that.
Reply
#3

omg.... i really don't understund nothing about thi code.... please read this, is helpfull!

https://sampforum.blast.hk/showthread.php?tid=199560
Reply
#4

Okay thank you, its gone now
Reply
#5

no warn now?
Reply
#6

I don't see why you don't just use GetPlayerState() -.-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)