Teleportation [Need Help]
#1

Okay mates. I kinda did this command but i am not able to make it that when some one types /passin and he is in a vehicle he will get teleported with the vehicle cause when some one is in the vehicle the car stays where the entrance is and he gets teleported inside.

Код:
if(strcmp(cmdtext, "/passin", true, 6) == 0)
	{
  		if(IsPlayerInRangeOfPoint(playerid, 15, -227.0744,996.9635,19.5682)) // Police enterance
  		{
    		SetPlayerPos(playerid, 2257.3301,2498.6348,1.7257); // these are coordinates where he'll spawn (PD INT)
    		return 1;
			}
 			return 1;
    		}
Reply
#2

Quote:
Originally Posted by Karl1195
Посмотреть сообщение
Okay mates. I kinda did this command but i am not able to make it that when some one types /passin and he is in a vehicle he will get teleported with the vehicle cause when some one is in the vehicle the car stays where the entrance is and he gets teleported inside.

Код:
if(strcmp(cmdtext, "/passin", true, 6) == 0)
	{
  		if(IsPlayerInRangeOfPoint(playerid, 15, -227.0744,996.9635,19.5682)) // Police enterance
  		{
    		SetPlayerPos(playerid, 2257.3301,2498.6348,1.7257); // these are coordinates where he'll spawn (PD INT)
    		return 1;
			}
 			return 1;
    		}
Can you explain better?
Reply
#3

Something like:
pawn Код:
if(strcmp(cmdtext, "/passin", true, 6) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 15, -227.0744,996.9635,19.5682)) // Police enterance
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
            RemovePlayerFromVehicle(playerid);
            }
            SetPlayerPos(playerid, 2257.3301,2498.6348,1.7257); // these are coordinates where he'll spawn (PD INT)
            return 1;
            }
            return 1;
            }
Reply
#4

Use SetVehiclePos it will teleport the vehicle with players inside. (if i remember correctly) If it does not port the player use "PutPlayerInVehicle" too.
pawn Код:
SetVehiclePos(GetPlayerVehicleID(playerid), 2257.3301,2498.6348,1.7257);
Reply
#5

iggy1 did understanded me. I want that when a player do /passin and he is ina car the car will also get tped.


EDIT: I TRIED BOTH OF IGGY'S but none worked.
Reply
#6

pawn Код:
if(strcmp(cmdtext, "/passin", true, 6) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 15, -227.0744,996.9635,19.5682)) // Police enterance
        {
            new vid = GetPlayerVehicleID(playerid)
            if(vid != 0)
            {
            SetVehiclePos(GetPlayerVehicleID(playerid), 2257.3301,2498.6348,1.7257);
            }
            SetPlayerPos(playerid, 2257.3301,2498.6348,1.7257); // these are coordinates where he'll spawn (PD INT)
        }
    return 1;
    }
Reply
#7

Thanks for the help.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)