Vehicle Control - 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: Vehicle Control (
/showthread.php?tid=206304)
Vehicle Control -
Osviux - 03.01.2011
How can i control my vehicles doors, lights, boot, bonnet, engine and alarm in 0.3c?
I tried this with the engine and would with everything but
Код:
C:\Users\Labas\Desktop\GM\gamemodes\GM.pwn(382) : warning 219: local variable "objective" shadows a variable at a preceding level
C:\Users\Labas\Desktop\GM\gamemodes\GM.pwn(12092) : warning 219: local variable "objective" shadows a variable at a preceding level
Код:
if(dialogid == 802)
{
if(response)
{
if(listitem == 0)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
}
if(listitem == 1)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
}
}
return 1;
}
Re: Vehicle Control -
Doom8890 - 03.01.2011
You probably declared public variable 'objective' somewhere. Check your code for those variables.
Re: Vehicle Control -
Osviux - 03.01.2011
Here they are. What should i do with them?
Код:
forward SetVehicleParamsForPlayerEx(vehicleid,playerid,objective,doorslocked);
public SetVehicleParamsForPlayerEx(vehicleid,playerid,objective,doorslocked)
{
Vehiclez[vehicleid][playerid][o] = objective;
Vehiclez[vehicleid][playerid][l] = doorslocked;
if(IsVehicleStreamedIn(vehicleid, playerid))
return SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked);
return 1;
}
And
Код:
public SetVehicleParamsForAll(carid,objective,doorslocked)
{
new i;
for(i=0; i<MAX_PLAYERS; i++) { SetVehicleParamsForPlayer(carid,i,objective,doorslocked); }
}