Jump to content
  • 0

Problema lock vehicle / unlock vehicle


Adolph

Question

salut, cum pot sa fac sa nu mai mearga sa te urci in masina tu ca owner daca e inchisa gen

acum daca sunt owner de vehicul, pot intra fara sa apas N sau /lock. Ceea ce vreau e sa pot da inainte /lock ca sa o deschid si apoi sa ma urc, mi-a dat batai mari de cap si nu stiu ce sa ii fac, putin ajutor daca va rog ?

CMD:lock(playerid, params[]) {
	new engine,lights,alarm,doors,bonnet,boot,objective;
	for(new v; v < MAX_PERSONAL_VEHICLES; v++)
	{
	    if(CheckPlayerDistanceToVehicle(5.0, playerid, PlayerInfo[playerid][pCarID][v])) {
			if(PlayerInfo[playerid][pCarLock][v] == 1) {
	    		GetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,doors,bonnet,boot,objective);
	      	    SetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,0,bonnet,boot,objective);
	      	    va_GameTextForPlayer(playerid, "~h~%s~n~~g~Unlocked", 5000, 3, aVehicleNames[PlayerInfo[playerid][pCarModel][v] - 400]);
				PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
				PlayerInfo[playerid][pCarLock][v] = 0;
				gCarLock[PlayerInfo[playerid][pCarID][v]] = 0;
				cUpdate(playerid, v, cLockx);
				return true;
			}
			else {
	    		GetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,doors,bonnet,boot,objective);
	      	    SetVehicleParamsEx(PlayerInfo[playerid][pCarID][v],engine,lights,alarm,1,bonnet,boot,objective);
				SetVehicleParamsForPlayer(PlayerInfo[playerid][pCarID][v],playerid,0,0);
				va_GameTextForPlayer(playerid, "~h~%s~n~~r~Locked", 5000, 3, aVehicleNames[PlayerInfo[playerid][pCarModel][v] - 400]);
				PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
				PlayerInfo[playerid][pCarLock][v] = 1;
				gCarLock[PlayerInfo[playerid][pCarID][v]] = 1;
				cUpdate(playerid, v, cLockx);
			    return true;
			}
		}
		else if(CheckPlayerDistanceToVehicle(5.0, playerid, HireCar[playerid])) {
			new carid = HireCar[playerid];
			if(gCarLock[carid] == 0) {
		        new vehicles = GetVehicleModel(carid) - 400;
		        va_GameTextForPlayer(playerid, "~h~%s~n~~r~Locked", 5000, 3, aVehicleNames[vehicles]);
	  	        PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
				gCarLock[carid] = 1;
    			GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
      	    	SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,1,bonnet,boot,objective);
	            return true;
		    }
			else if(gCarLock[carid] == 1) {
				new vehicles = GetVehicleModel(carid) - 400;
				va_GameTextForPlayer(playerid, "~h~%s~n~~g~Unlocked", 5000, 3, aVehicleNames[vehicles]);
				PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
				gCarLock[carid] = 0;
    			GetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
      	    	SetVehicleParamsEx(HireCar[playerid],engine,lights,alarm,0,bonnet,boot,objective);
	            return true;
			}
		}
		else if(CheckPlayerDistanceToVehicle(5.0, playerid, RentCar[playerid])) {
			new carid = RentCar[playerid];
			if(gCarLock[carid] == 0) {
			    GameTextForPlayer(playerid, "~h~rentcar~n~~r~locked", 5000, 3);
	  	        PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
				gCarLock[carid] = 1;
    			GetVehicleParamsEx(RentCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
      	    	SetVehicleParamsEx(RentCar[playerid],engine,lights,alarm,1,bonnet,boot,objective);
	            return true;
		    }
			else if(gCarLock[carid] == 1) {
			    GameTextForPlayer(playerid, "~h~rentcar~n~~g~unlocked", 5000, 3);
				PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
				gCarLock[carid] = 0;
    			GetVehicleParamsEx(RentCar[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
      	    	SetVehicleParamsEx(RentCar[playerid],engine,lights,alarm,0,bonnet,boot,objective);
	            return true;
			}
		}
	}
    return true; }

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Costin Mantea1
      Salutare ma ajutati va rog sa termin adaugarea de Vehicule pentru Clan, aici am  doar partea de Dialog:
       
    • By R4zvyy
      Salutare, am o problema cu vehiculele, atunci cand cumpar manual VIP, VIP Plus, Rainbow, stage si neon nu se salveaza

      ma ajuta careva?
    • By nQeed
      https://youtu.be/rcE77VlPbfI
      o parere?
      Ionel#6666 // discord.
    • By St3f4n36
      Cum as putea fac urmatoarea chestie:
      Daca intr-un dialog imi apare ca primeste x bani daca apasa cazul 1 ( banii formati cu new money = 100 + rand(100); )
      si dupa sa imi trimita un mesaj tot cu aceasi suma de bani x. Trebuie salvata intr-o variabila sau cum?
    • By xVincenzo
      salut cum pot rezolva aceasta eroare? 
      error 033: array must be indexed (variable "gString")
       
      aceasta este linia de cod: gString = EOS; format(gString, sizeof(gString), "Ti-a fost setat Nitro Account la valoarea %d de catre administratorul %s.", valoare , GetName(playerid));
          SCM(id, COLOR_LIGHTBLUE, gString);
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.