[HElP]/exit command won't work
#1

Ok when i do /exit for the house it doesnt work and when i do /gotols i see no vehicles there heres my command


Код:
if(strcmp(cmd, "/exit", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				//printf("House :%d",i);
				if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
				{
				  if(HouseEntered[playerid] == i)
				  {
						SetPlayerInterior(playerid,0);
						SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
						PlayerInfo[playerid][pInt] = 0;
						PlayerInfo[playerid][pLocal] = 255;
						SetCameraBehindPlayer(playerid);
						SetPlayerVirtualWorld(playerid,0);
						HouseEntered[playerid] = 255;
						if(HouseInfo[i][hHel] == 1)
						{
							new Float:tempheal;
							GetPlayerHealth(playerid,tempheal);
							if(tempheal < 100.0)
							{
								SetPlayerHealth(playerid,100.0);
							}
						}
						return 1;
					}
				}
			}
			for(new i = 0; i < sizeof(BizzInfo); i++)
			{
				//printf("Bizz :%d",i);
				if (PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
				{
					SetPlayerInterior(playerid,0);
					PlayerInfo[playerid][pInt] = 0;
					SetPlayerPos(playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]);
					PlayerInfo[playerid][pLocal] = 255;
				}
			}
			new carid = GetPlayerVehicleID(playerid);
			if (IsABus(carid))
			{
				TogglePlayerControllable(playerid, 1);
				//GangZoneHideForPlayer(playerid, buszoneeast);
				//GangZoneHideForPlayer(playerid, buszonewest);
				RemovePlayerFromVehicle(playerid);
				if (BusrouteEast[playerid][0] != 0 || BusrouteWest[playerid][0] != 0) BusrouteEnd(playerid, carid);
			}
			if (IsASweeper(carid))
			{
				TogglePlayerControllable(playerid, 1);
				RemovePlayerFromVehicle(playerid);
			}
			if(IsAHarvest(carid))
			{
			  if (carid != 0)
				{
					SetVehicleToRespawn(carid);
				}
				if(FarmerPickup[playerid][0] >= 1 && FarmerPickup[playerid][0] <= 22)
				{
					FarmerPickup[playerid][0]--;
				}
			  TogglePlayerControllable(playerid, 1);
			  RemovePlayerFromVehicle(playerid);
			  FarmerVar[playerid] = 0;
			  DisablePlayerCheckpoint(playerid);
			  
			}
			if(IsADrugHarvest(carid))
			{
			  if (carid != 0)
			  {
			    SetVehicleToRespawn(carid);
			  }
			  if(DrugFarmerPickup[playerid][0] >= 1 && DrugFarmerPickup[playerid][0] <= 37)
			  {
			    DrugFarmerPickup[playerid][0]--;
			  }
			  TogglePlayerControllable(playerid, 1);
			  RemovePlayerFromVehicle(playerid);
			  DrugFarmerVar[playerid] = 0;
			  DisablePlayerCheckpoint(playerid);
			}
			if(IsASmuggleCar(carid))
			{
			  if(carid != 0)
			  {
			    SetVehicleToRespawn(carid);
			  }
			  TogglePlayerControllable(playerid, 1);
			  RemovePlayerFromVehicle(playerid);
			  SmugglerWork[playerid] = 0;
			  DisablePlayerCheckpoint(playerid);
			}
			if(IsAnOwnableCar(carid) && CarInfo[carid][cOwned] == 0)
	  		{
	    	TogglePlayerControllable(playerid, 1);
	    	RemovePlayerFromVehicle(playerid);
	  	}
	  	if(IsPlayerInAnyVehicle(playerid) && !engineOn[GetPlayerVehicleID(playerid)] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	  	{
	  	  TogglePlayerControllable(playerid, 1);
				RemovePlayerFromVehicle(playerid);
			}
			if(GetPlayerVehicleID(playerid) >= 112 && GetPlayerVehicleID(playerid) <= 130 || GetPlayerVehicleID(playerid) >= 135 && GetPlayerVehicleID(playerid) <= 154)
			{
				TogglePlayerControllable(playerid, 1);
				RemovePlayerFromVehicle(playerid);
			}
			else if (PlayerToPoint(3.0, playerid,387.7978,173.8582,1008.3828))
			{
			  SetPlayerInterior(playerid,0);
				SetPlayerPos(playerid,1481.0206,-1771.1138,18.7958);
				PlayerInfo[playerid][pInt] = 0;
				PlayerInfo[playerid][pLocal] = 255;
			}
			else if (PlayerToPoint(6.0, playerid,-1404.5299,-259.0602,1043.6563))
			{
			  SetPlayerInterior(playerid,0);
			  PlayerInfo[playerid][pInt] = 0;
				SetPlayerPos(playerid,2695.6235,-1704.6960,11.8438);
			}
			else if (PlayerToPoint(8.0, playerid,-1443.0554,-581.1879,1055.0472))
			{
			  SetPlayerInterior(playerid,0);
			  PlayerInfo[playerid][pInt] = 0;
				SetPlayerPos(playerid,-2111.5686,-443.9720,38.7344);
			}
			else if (PlayerToPoint(8.0, playerid,-1464.7732,1557.5533,1052.5313))
			{
			  SetPlayerInterior(playerid,0);
			  PlayerInfo[playerid][pInt] = 0;
				SetPlayerPos(playerid,-2080.3079,-406.0309,38.7344);
			}
			else if(NoFuel[playerid] == 1)
			{
			  TogglePlayerControllable(playerid, 1);
				RemovePlayerFromVehicle(playerid);
				NoFuel[playerid] = 0;
			}
		}
		return 1;
	}
Reply
#2

Got the same problem, when somone knows how to fix please reply or PM me
Reply
#3

Quote:
Originally Posted by ModernRP
Got the same problem, when somone knows how to fix please reply or PM me
Same for me
Reply
#4

open gl_property.pwn and look at there /exit command its on line 732 here it is if u dont have it:

Код:
	else if(strcmp("/exit", cmd, true) == 0) // exit property
	{
	  if( currentInt[playerid] > -1 && GetPlayerInterior(playerid) == GetPropertyInteriorId( currentInt[playerid] )){

	    new id = currentInt[playerid];
	    new Float:x;
			new	Float:y;
			new	Float:z;
			new	Float:a;

			// make sure they're near the exit before allowing them to exit.
			GetPropertyExit( id, x, y, z );
			if(!IsPlayerInRangeOfPoint(playerid,4.5,x,y,z)) {
			  SendClientMessage(playerid,0xDDAA55FF,"* You must be near the property exit to /exit");
			  return 1;
			}

			a = GetPropertyEntrance( id, x, y, z );
			SetPlayerPos( playerid, x, y, z );
			SetPlayerFacingAngle( playerid, a );
			SetPlayerInterior( playerid, 0 );
			SetPlayerVirtualWorld( playerid, 0 );
		}
		currentInt[playerid] = -1;
		return 1;
	}
Reply
#5

Hmm, Ive already got that part, its the same as yours, but the /exit still doesn't work (sometimes it doesn't, espcially when I've just bought a house it doesn't work).

Код:
	else if(strcmp("/exit", cmd, true) == 0) // exit property
	{
	  if( currentInt[playerid] > -1 && GetPlayerInterior(playerid) == GetPropertyInteriorId( currentInt[playerid] )){

	    new id = currentInt[playerid];
	    new Float:x;
			new	Float:y;
			new	Float:z;
			new	Float:a;

			// make sure they're near the exit before allowing them to exit.
			GetPropertyExit( id, x, y, z );
			if(!IsPlayerInRangeOfPoint(playerid,4.5,x,y,z)) {
			  SendClientMessage(playerid,0xDDAA55FF,"* You must be near the property exit to /exit");
			  return 1;
			}

			a = GetPropertyEntrance( id, x, y, z );
			SetPlayerPos( playerid, x, y, z );
			SetPlayerFacingAngle( playerid, a );
			SetPlayerInterior( playerid, 0 );
			SetPlayerVirtualWorld( playerid, 0 );
		}
		currentInt[playerid] = -1;
		return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)