SA-MP Forums Archive
Someone please help me! - 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: Someone please help me! (/showthread.php?tid=200462)



Someone please help me! - Jack_Rocker - 18.12.2010

Okay, basically I made this up, I know its written wrong, but someone MUST know where Im trying to get!!

if the lights are on I want 'key_jump' be able to turn them off same goes for the other way round. Can anyone correct this code? If you could that would be awesome

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
   if(newkeys == KEY_FIRE)
   {
		if ((GetVehicleParamsEx) == vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
	 new vid = GetPlayerVehicleID(playerid);
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
            else
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
       }
}



Re: Someone please help me! - Ironboy500[TW] - 18.12.2010

Код:
new LightsSTATE; //top of script

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
   if(newkeys == KEY_FIRE)
   {
            new vid = GetPlayerVehicleID(playerid);
            if(LightsSTATE == 0)
            {
                   GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                   SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
                   LightsSTATE = 1;
            }
            else
            {
                   GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                   SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
                   LightsSTATE = 0;           
            }       
    }
}



Re: Someone please help me! - Jack_Rocker - 18.12.2010

Dude! you are awesome! thanks