SA-MP Forums Archive
11 warnings - 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: 11 warnings (/showthread.php?tid=71081)



11 warnings - CAMERON_BANFIELD - 29.03.2009

Код:
C:\Documents and Settings\Cameron Banfield\Desktop\Jack.pwn(3401) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
C:\Documents and Settings\Cameron Banfield\Desktop\Jack.pwn(3406) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
C:\Documents and Settings\Cameron Banfield\Desktop\Jack.pwn(3476) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
C:\Documents and Settings\Cameron Banfield\Desktop\Jack.pwn(3531) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
C:\Documents and Settings\Cameron Banfield\Desktop\Jack.pwn(3544) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
C:\Documents and Settings\Cameron Banfield\Desktop\Jack.pwn(3564) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
C:\Documents and Settings\Cameron Banfield\Desktop\Jack.pwn(3577) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
C:\Documents and Settings\Cameron Banfield\Desktop\Jack.pwn(3590) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
C:\Documents and Settings\Cameron Banfield\Desktop\Jack.pwn(4069) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
C:\Documents and Settings\Cameron Banfield\Desktop\Jack.pwn(4074) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
C:\Documents and Settings\Cameron Banfield\Desktop\Jack.pwn(4139) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


11 Warnings.
that code is this
Код:
	vehicleid = AddStaticVehicle(504,-1344.7548,934.0552,1036.1246,10.9500,57,38); // Bloodring
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1348.3937,932.7709,1036.1276,12.8532,45,29); // Bloodring
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1352.8406,932.4301,1036.1116,12.4009,34,9); // Bloodring
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1357.1481,931.3373,1036.1133,9.6392,65,9); // Bloodring
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1339.7054,935.2197,1036.1375,11.9543,14,1); // Bloodring
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1333.6619,936.5991,1036.1868,21.3523,12,9); // Bloodring
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1326.8384,938.8602,1036.2212,21.5350,26,1); // Bloodring
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1321.7042,940.8719,1036.2427,22.3613,51,39); // Bloodring
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1313.7328,944.8049,1036.2551,29.4247,57,38); // Bloodring
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1307.1583,948.4879,1036.3197,28.7934,45,29); // Bloodring
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1442.0344,1095.6201,1040.0989,293.6147,51,39); // Derby
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1429.6360,1100.3323,1040.0769,288.0984,51,39); // Derby
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1420.2389,1103.0682,1040.0638,282.0381,51,39); // Derby
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1405.8097,1105.9205,1040.0731,271.4767,51,39); // Derby
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1392.3328,1105.8337,1040.0475,266.0120,51,39); // Derby
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1379.7574,1104.3181,1040.0413,252.9348,51,39); // Derby
	LinkVehicleToInterior(vehicleid,15);
	vehicleid = AddStaticVehicle(504,-1366.6641,1099.5990,1039.9989,247.6617,51,39); // Derby
	LinkVehicleToInterior(vehicleid,15);



Re: 11 warnings - Chaprnks - 29.03.2009

Name then with different names. Ex: vehicle1, vehicle2


Re: 11 warnings - Pyrokid - 29.03.2009

Or you could do it this way (I use this way for my GM because it makes it easier to perform an action on all the cars at once with a loop).

Top of your script
pawn Код:
new intveh[30]; //I don't know how many cars you actually have. Change the number to fit your actual number of cars you're linking.
Then OnGameModeInit
pawn Код:
intveh[1] = AddStaticVehicle(...);
    LinkVehicleToInterior(intveh[1],15);

    intveh[2] = AddStaticVehicle(...);
    LinkVehicleToInterior(intveh[2],15);

    intveh[3] = AddStaticVehicle(...);
    LinkVehicleToInterior(intveh[3],15);
This way in the future if you ever wanna destroy them all you can just use a loop.


Re: 11 warnings - CAMERON_BANFIELD - 29.03.2009

thankyou