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: Warning (
/showthread.php?tid=156842)
Warning -
iLcke - 24.06.2010
Code
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new vehicleid = GetPlayerVehicleID(playerid); // Line 827
AddVehicleComponent(vehicleid, 1010);
return 1;
}
warning
Код:
C:\Users\Andrew\Desktop\NewServer\gamemodes\MyScript.pwn(827) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
Re: Warning -
introzen - 24.06.2010
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new vehicle = GetPlayerVehicleID(playerid); // Line 827
AddVehicleComponent(vehicle, 1010);
return 1;
}
Re: Warning -
LTomi - 24.06.2010
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
AddVehicleComponent(vehicleid, 1010);
return 1;
}
The 'vehicleid', namely the id of the vehicle that the player is getting in is already defined in the header, so it is unnecessary to define it again.