SA-MP Forums Archive
Error With Vehicles - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error With Vehicles (/showthread.php?tid=553636)



Error With Vehicles - ranslsad - 30.12.2014

Hello, Im breaking a bit the head with a problem I am having and I fail to see where it comes from.

The problem is that I have a set of doors that pressing the button and enter an interior, and then exit with the same method.

I have an teleport system who teleport the user to an interior. and he can back again pressing Y.

Then when car is near of these positions and this teleport is used by multiple users, some cars changed his position, sometimes the positions of all nearby vehicles are changed.

Greetings

Ranslsad


Re : Error With Vehicles - MCZOFT - 31.12.2014

can we see the commands of the Y enter and Exit as you said ?


Respuesta: Error With Vehicles - ranslsad - 21.01.2015

Yes, its dynamic gate.

Код:
//**********************************************************************
		for(new i = 0; i <MAX_PUERTAS; i++) //Puertas Dinamicas
		{
		    new playerState = GetPlayerState(playerid);
			if(playerState == PLAYER_STATE_ONFOOT)
			{
				if(IsPlayerInRangeOfPoint(playerid,2.0,Puerta[i][PEnterX],Puerta[i][PEnterY],Puerta[i][PEnterZ]))
				{
				    //if(IsPlayerInAnyVehicle(playerid)) return 1;
					if(Puerta[i][PCerrado] == 1) return SendClientMessage(playerid, COLOR_RED, "La puerta esta cerrada.");
					SetPlayerVirtualWorld(playerid, Puerta[i][PExitVW]);
					SetPlayerPos(playerid, Puerta[i][PExitX], Puerta[i][PExitY], Puerta[i][PExitZ]);
					SetPlayerInterior(playerid, Puerta[i][PExitInt]);
					return 1;
				}
				if(IsPlayerInRangeOfPoint(playerid,2.0,Puerta[i][PExitX],Puerta[i][PExitY],Puerta[i][PExitZ]))
				{
				    //if(IsPlayerInAnyVehicle(playerid)) return 1;
					if(Puerta[i][PCerrado] == 1) return SendClientMessage(playerid, COLOR_RED, "La puerta esta cerrada.");
					SetPlayerVirtualWorld(playerid, Puerta[i][PEnterVW]);
					SetPlayerPos(playerid, Puerta[i][PEnterX], Puerta[i][PEnterY], Puerta[i][PEnterZ]);
					SetPlayerInterior(playerid, Puerta[i][PEnterInt]);
					return 1;
				}
			}
		}
I still have this error.