SA-MP Forums Archive
Little simple help about engine system :D - 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)
+--- Thread: Little simple help about engine system :D (/showthread.php?tid=611671)



Little simple help about engine system :D - Youssefree - 09.07.2016

Hello,
Can someone help me get the line that turns the engine on here ?
PHP код:
   }
   if (((
newkeys KEY_WALK && newkeys KEY_UP) || (newkeys KEY_WALK && newkeys KEY_DOWN) || (newkeys KEY_WALK && newkeys KEY_LEFT) || (newkeys KEY_WALK && newkeys KEY_RIGHT))
   || ((
oldkeys KEY_WALK && newkeys KEY_UP) || (oldkeys KEY_WALK && newkeys KEY_DOWN) || (oldkeys KEY_WALK && newkeys KEY_LEFT) || (oldkeys KEY_WALK && newkeys KEY_RIGHT))
   || ((
newkeys KEY_WALK && oldkeys KEY_UP) || (newkeys KEY_WALK && oldkeys KEY_DOWN) || (newkeys KEY_WALK && oldkeys KEY_LEFT) || (newkeys KEY_WALK && oldkeys KEY_RIGHT))
   && 
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
   {
        
walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
   }
   if(
newkeys == KEY_LOOK_BEHIND)
   {
       if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
       {
           new 
idcar GetPlayerVehicleID(playerid),string[128],sendername[25];
           if(
IsABike(idcar)) return 1;
           if(
Refueling[playerid] == 0)
             {
                if(
vehEngine[idcar] == 0)
               {
                   
vehEngine[idcar] = 1;
                   
GetVehicleParamsEx(idcar,engine,lights,alarm,doors,bonnet,boot,objective);
                   
SetVehicleParamsEx(idcar,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                   new 
vehicle;
                   
vehicle GetVehicleModel(idcar) - 400;
                   
GetPlayerName(playeridsendernamesizeof(sendername));
                   
SetPVarInt(playerid"Engine"1);
                   if(
Undercover[playerid] != 0)
                   {
                       
format(string,sizeof(string),"* An unknown hitman starts the engine of his %s.",aVehicleNames[vehicle]);
                       
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                   }
                   else
                   {
                       
format(string,sizeof(string),"* %s starts the engine of his %s.",sendername,aVehicleNames[vehicle]);
                       
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                   }
               }
                   else if(
vehEngine[idcar] == 1)
               {
                   
vehEngine[idcar] = 0



Re: Little simple help about engine system :D - Youssefree - 09.07.2016

Can it be ?
Quote:

if(vehEngine[idcar] == 0)
(vehEngine[idcar] == 1)




Re: Little simple help about engine system :D - luke49 - 09.07.2016

PHP код:
SetVehicleParamsEx(idcar,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective); 
VEHICLE_PARAMS_ON turns on the engine.


Re: Little simple help about engine system :D - Luicy. - 09.07.2016

*facepalm*
SetVehicleParamsEx(idcar,VEHICLE_PARAMS_ON,lights, alarm,doors,bonnet,boot,objective);


Re: Little simple help about engine system :D - Youssefree - 09.07.2016

Thanks all