[Pomoc] Paljenje vozila na broj

Započeo Milan || WG, Maj 06, 2013, 00:05:40 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta: CLRP
Problem: Mozel neko da mi uradi paljenje vozila na broj 2... evo komanda.
Dio skripte:
   if(!strcmp(cmd, "/u", true) || strcmp(cmd, "/upali", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         if(IsPlayerInAnyVehicle(playerid))
         {
             if(!engineOn[GetPlayerVehicleID(playerid)])
             {
                 if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
               {
                  return 1;
               }
               if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
               {
                  return 1;
               }
               if(idcar == 59 || idcar == 60)
               {
                  return 1;
               }
               if(idcar >= 135 && idcar <= 154)
               {
                   if(HireCar[playerid] != idcar)
                   {
                     return 1;
                  }
               }
               if(IsAPlane(idcar))
               {
                   return 1;
               }
               if(IsAHarvest(idcar))
               {
                   return 1;
               }
               if(IsADrugHarvest(idcar))
               {
                   return 1;
               }
               if(IsASweeper(idcar))
               {
                   return 1;
               }
               if(IsARaceCar(idcar))
               {
                   return 1;
               }
               if(gEngine[playerid] == 1) { return 1; }

               new playerveh = GetPlayerVehicleID(playerid);
               PutPlayerInVehicle(playerid, playerveh, 0);
               GetPlayerName(playerid, sendername, sizeof(sendername));
               format(string, sizeof(string), "%s pali vozilo.", sendername);
               TextDrawShowForPlayer(playerid, TDSpeedo3);
               ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
               SetTimerEx("StartingTheVehicle",10,0,"i",playerid);
               gEngine[playerid] = 1;
               return 1;

            }
            if(engineOn[GetPlayerVehicleID(playerid)])
             {
                 if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
               {
                  return 1;
               }
               if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
               {
                  return 1;
               }
               if(idcar == 59 || idcar == 60)
               {
                  return 1;
               }
               if(idcar >= 161 && idcar <= 210)
               {
                   if(HireCar[playerid] != idcar)
                   {
                     return 1;
                  }
               }
               if(IsAHarvest(idcar))
               {
                   return 1;
               }
               if(IsADrugHarvest(idcar))
               {
                   return 1;
               }
               if(IsAPlane(idcar))
               {
                   return 1;
               }
               if(IsASweeper(idcar))
               {
                   return 1;
               }
               if(IsARaceCar(idcar))
               {
                   return 1;
               }
               if(gEngine[playerid] == 1) { return 1; }

               new playerveh = GetPlayerVehicleID(playerid);
               PutPlayerInVehicle(playerid, playerveh, 0);
               GetPlayerName(playerid, sendername, sizeof(sendername));
               sendername[strfind(sendername,"_")] = ' ';
         TextDrawHideForPlayer(playerid, TDSpeedo3);
               format(string, sizeof(string), "Vozilo je vec upaljeno.", sendername);
               ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
               SetTimerEx("StartingTheVehicle",1,0,"i",playerid);
               gEngine[playerid] = 0;
               return 1;
            }
         }
       }
       return 1;
   }

nadji pod onplayerkeystatechange ovako nesto "KEY_JUMP" i posalji ti ovde

if(newkeys == KEY_SUBMISSION && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  {
            new vehicleid = GetPlayerVehicleID(playerid);
  if(MotorVozila[playerid] == 0)
{
new pali[128],engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, 0, alarm, doors, bonnet, boot, objective);
MotorVozila[playerid] = 1;
format(pali,sizeof(pali),"{009DFF}%s {FFFFFF}stavlja kljuc u bravu i pali motor vozila ...",GetName(playerid));
ProxDetector(20.0, playerid, pali, LJUBICASTA, LJUBICASTA, LJUBICASTA, LJUBICASTA, LJUBICASTA);
}
  else if(MotorVozila[playerid] == 1)
  {
new gasi[128],engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, 0, alarm, doors, bonnet, boot, objective);
MotorVozila[playerid] = 0;
format(gasi,sizeof(gasi),"{009DFF}%s {FFFFFF}okrece kljuc i gasi motor vozila ...",GetName(playerid));
ProxDetector(5.0, playerid, gasi, LJUBICASTA, LJUBICASTA, LJUBICASTA, LJUBICASTA, LJUBICASTA);
}
}
}
    return 1;
}


Odatle sebi izvuci...



if(newkeys == KEY_SUBMISSION)
{
    if(IsPlayerConnected(playerid))
       {
         if(IsPlayerInAnyVehicle(playerid))
         {
             if(!engineOn[GetPlayerVehicleID(playerid)])
             {
                 if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
               {
                  return 1;
               }
               if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
               {
                  return 1;
               }
               if(idcar == 59 || idcar == 60)
               {
                  return 1;
               }
               if(idcar >= 135 && idcar <= 154)
               {
                   if(HireCar[playerid] != idcar)
                   {
                     return 1;
                  }
               }
               if(IsAPlane(idcar))
               {
                   return 1;
               }
               if(IsAHarvest(idcar))
               {
                   return 1;
               }
               if(IsADrugHarvest(idcar))
               {
                   return 1;
               }
               if(IsASweeper(idcar))
               {
                   return 1;
               }
               if(IsARaceCar(idcar))
               {
                   return 1;
               }
               if(gEngine[playerid] == 1) { return 1; }

               new playerveh = GetPlayerVehicleID(playerid);
               PutPlayerInVehicle(playerid, playerveh, 0);
               GetPlayerName(playerid, sendername, sizeof(sendername));
               format(string, sizeof(string), "%s pali vozilo.", sendername);
               TextDrawShowForPlayer(playerid, TDSpeedo3);
               ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
               SetTimerEx("StartingTheVehicle",10,0,"i",playerid);
               gEngine[playerid] = 1;
               return 1;

            }
            if(engineOn[GetPlayerVehicleID(playerid)])
             {
                 if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
               {
                  return 1;
               }
               if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
               {
                  return 1;
               }
               if(idcar == 59 || idcar == 60)
               {
                  return 1;
               }
               if(idcar >= 161 && idcar <= 210)
               {
                   if(HireCar[playerid] != idcar)
                   {
                     return 1;
                  }
               }
               if(IsAHarvest(idcar))
               {
                   return 1;
               }
               if(IsADrugHarvest(idcar))
               {
                   return 1;
               }
               if(IsAPlane(idcar))
               {
                   return 1;
               }
               if(IsASweeper(idcar))
               {
                   return 1;
               }
               if(IsARaceCar(idcar))
               {
                   return 1;
               }
               if(gEngine[playerid] == 1) { return 1; }

               new playerveh = GetPlayerVehicleID(playerid);
               PutPlayerInVehicle(playerid, playerveh, 0);
               GetPlayerName(playerid, sendername, sizeof(sendername));
               sendername[strfind(sendername,"_")] = ' ';
         TextDrawHideForPlayer(playerid, TDSpeedo3);
               format(string, sizeof(string), "Vozilo je vec upaljeno.", sendername);
               ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
               SetTimerEx("StartingTheVehicle",1,0,"i",playerid);
               gEngine[playerid] = 0;
               return 1;
            }
         }
       }


}

eto ;)