Jump to content
  • 0

Problema /park!


Alecsandro

Question

Salut am si eu comanda /park pt a parca masina insa doresc sa parcheze masina cum e ea normal adica daca iese fum din ea sa nu o respawneze ca nou sa o parcheze cazand de sus tot asa dar fara sa o repare sa schimbe nimic.

if(strcmp(cmd, "/park", true) == 0)
	{
		if(IsPlayerConnected(playerid))
 		{
	     		new Float:x,Float:y,Float:z;
				new Float:a;
				new carid;
				new getcarid;
				if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCar]) { carid = PlayerInfo[playerid][pCar]; }
				else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pMoto]) { carid = PlayerInfo[playerid][pMoto]; }
				else { return 1; }
				getcarid = GetPlayerVehicleID(playerid);
    	    	GetPlayerName(playerid, playername, sizeof(playername));
				GetVehiclePos(carid, x, y, z);
				GetVehicleZAngle(carid, a);
				if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
				{
		   			if(PlayerInfo[playerid][pCar] == 999 && PlayerInfo[playerid][pMoto] == 999)
					{
						SCM(playerid, COLOR_GREY, "** You don't own a car or moto !");
						return 1;
					}
	    			if(getcarid == carid || EngineSTATE[carid] == 1)
					{
						CarInfo[carid][cLocationx] = x;
						CarInfo[carid][cLocationy] = y;
						CarInfo[carid][cLocationz] = z;
						CarInfo[carid][cAngle] = a;
      					TogglePlayerControllable(playerid, 1);
						format(string, sizeof(string), "~g~%s ~n~~w~has saved in the position",CarInfo[carid][cModel]);
						GameTextForPlayer(playerid, string, 5000, 1);
						SetVehicleNumberPlate(carid,CarInfo[carid][cPlate]);
						SetVehicleToRespawn(carid);
						PutPlayerInVehicle(playerid, carid, 0);
						GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
           				SetVehicleParamsEx(carid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
           				EngineSTATE[carid] = 1;
           				OnPropUpdate();
						OnPlayerUpdate(playerid);
						return 1;
					}
			}
			else
			SCM(playerid, COLOR_CRS3, "** The parking lot is busy, search other.");
			return 1;
		}
		return 1;
	}

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.