[HELP] State Warning - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] State Warning (
/showthread.php?tid=215703)
[HELP] State Warning -
NotoriousMOB - 23.01.2011
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
Re: [HELP] State Warning -
Mike Garber - 23.01.2011
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.
Re: [HELP] State Warning -
ricardo178 - 23.01.2011
omg.... i really don't understund nothing about thi code.... please read this, is helpfull!
https://sampforum.blast.hk/showthread.php?tid=199560
Re: [HELP] State Warning -
NotoriousMOB - 23.01.2011
Okay thank you, its gone now
Re: [HELP] State Warning -
ricardo178 - 23.01.2011
no warn now?
Re: [HELP] State Warning -
Antonio [G-RP] - 24.01.2011
I don't see why you don't just use GetPlayerState() -.-