Vehicle Control
#1

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;
   }
Reply
#2

You probably declared public variable 'objective' somewhere. Check your code for those variables.
Reply
#3

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); }
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)