Jump to content

Question

Posted

Problema intalnita (descriere): am facut o comanda atunci cand apesi pe Y sa aprinzi farurile dar nu se aprind zice mesajul ca sunt aprinse respectiv stinse dar nu merge dar daca dau /lights o alta comada facuta se aprind
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul:

 

 

if (PRESSED(KEY_YES))
    {
        new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective;
        if(VehicleLights[model] == 0)
        {
            VehicleLights[vehicleid] = 1;
            SendClientMessage(playerid, COLOR_YELLOW, "Lights Turned On");
            GetVehicleParamsEx(model, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(model, engine, 1, alarm, doors, bonnet, boot, objective);
        }
        else if(VehicleLights[model] == 1)
        {
            VehicleLights[model] = 0;
            SendClientMessage(playerid, COLOR_YELLOW, "Lights Turned Off");
            GetVehicleParamsEx(model, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(model, engine, 0, alarm, doors, bonnet, boot, objective);
        }
    }

 

Imagini / Video (optional):
Ati incercat sa rezolvati singur?: am incercat sa pun in loc de 0 si 1 false respectiv true

 

PS: la ongamemodeinit am manualvengineandlights si /lights merge

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn

5 answers to this question

Recommended Posts

  • 0
Posted

Doamne, si cum naiba poate exista asa ceva?

Adica macar ai vazut ca in comanda este new x_nr[24];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))

 

Sa inteleg ca atunci cand apas Y apare un dialog ca sa stie ca scriu lights si sa aprinda farurile si daca spui ca vrei sa copiez comanda lights pe Y am incercat am facut exact la fel si nu merge, incercati si voi sa vedeti daca merge.

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
  • 0
Posted

if(newkeys & KEY_YES)

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

  • 0
Posted
new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective;
    if(strcmp(cmd, "/veh", true) == 0) // By LordMan
    {
        if(IsPlayerConnected(playerid))
        {
            if(!IsModelABycicle(vehicleid))
               {
            new x_nr[24];
            x_nr = strtok(cmdtext, idx);
            if(!strlen(x_nr))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USE: /veh [1-5]");
               return 1;
            }
            if(strcmp(x_nr,"lights",true) == 0)
               {
                if(!IsPlayerInAnyVehicle(playerid))
                {
                    SendClientMessage(playerid, COLOR_RED, "Nu esti intr-un vehicul");
                    return 1;
                }
                if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    vehicleid = GetPlayerVehicleID(playerid);
                    if(VehicleLights[vehicleid] == 0)
                    {
                        VehicleLights[vehicleid] = 1;
                        SendClientMessage(playerid, COLOR_YELLOW, "Lights On");
                        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                        SetVehicleParamsEx(vehicleid, engine, true, alarm, doors, bonnet, boot, objective);
                    }
                    else if(VehicleLights[vehicleid] == 1)
                    {
                        VehicleLights[vehicleid] = 0;
                        SendClientMessage(playerid, COLOR_YELLOW, "Lights Off");
                        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                        SetVehicleParamsEx(vehicleid, engine, false, alarm, doors, bonnet, boot, objective);
                    }
                }
                return 1;
               }

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
  • 0
Posted
    if(newkeys & KEY_YES)
    {
    if(IsPlayerConnected(playerid))
    {
        if(!IsModelABycicle(vehicleid))
           {
      new x_nr[24];
      x_nr = strtok(cmdtext, idx);
      if(!strlen(x_nr))
      {
        SendClientMessage(playerid, COLOR_WHITE, "USE: /veh [1-5]");
         return 1;
      }
      if(strcmp(x_nr,"lights",true) == 0)
         {
        if(!IsPlayerInAnyVehicle(playerid))
        {
          SendClientMessage(playerid, COLOR_RED, "Nu esti intr-un vehicul");
          return 1;
        }
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
          vehicleid = GetPlayerVehicleID(playerid);
          if(VehicleLights[vehicleid] == 0)
          {
            VehicleLights[vehicleid] = 1;
            SendClientMessage(playerid, COLOR_YELLOW, "Lights On");
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicleid, engine, true, alarm, doors, bonnet, boot, objective);
          }
          else if(VehicleLights[vehicleid] == 1)
          {
            VehicleLights[vehicleid] = 0;
            SendClientMessage(playerid, COLOR_YELLOW, "Lights Off");
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicleid, engine, false, alarm, doors, bonnet, boot, objective);
          }
        }
        return 1;
       }
       }

242086.png

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.