SA-MP Forums Archive
Teleportation [Need Help] - 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: Teleportation [Need Help] (/showthread.php?tid=281480)



Teleportation [Need Help] - Karl1195 - 06.09.2011

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;
    		}



Re: Teleportation [Need Help] - FireCat - 06.09.2011

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?


Re: Teleportation [Need Help] - wouter0100 - 06.09.2011

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;
            }



Re: Teleportation [Need Help] - iggy1 - 06.09.2011

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);



Re: Teleportation [Need Help] - Karl1195 - 06.09.2011

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.


Re: Teleportation [Need Help] - =WoR=Varth - 06.09.2011

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;
    }



Re: Teleportation [Need Help] - Karl1195 - 06.09.2011

Thanks for the help.