WarpToPlayer

From Multi Theft Auto: Wiki

warpToPlayer

Syntax

bool warpToPlayer(player thePlayer, player thePlayerToWarpTo)

Required Arguments

  • thePlayer : The player you want to another player .
  • thePlayerToWarpTo : The player you will warp to .


Server


This functions is make player warp to another player.

Code

Click to collapse [-]
Function source
function warpToPlayer(thePlr,plrr)
	if getElementType(plrr) == "player" then
	
		if isPedInVehicle(plrr) then
		
			local veh = getPedOccupiedVehicle ( plrr )
			
				local maxp = getVehicleMaxPassengers ( veh )
				
					local passengers = getVehicleOccupants ( veh )
				
						if maxp > 1 and #passengers ~= maxp then
					
							warpPedIntoVehicle(thePlr,veh, #passengers+1)
							
					end
					
else
		
			local x,y,z = getElementPosition(plrr)
			
			setElementPosition(thePlr, x+1,y,z)
			
				end
		end
end


Author

!#DesTroyeR_,)