Need help with teleports
#2

Hi,

Regarding your code, if you want to make a teleport command, you will need just to change the following lines:

pawn Код:
CMD:sfa(playerid, params[])
{
    SpawnCheck(playerid);
    PassengerCheck(playerid);
    if(Restriction(playerid) == 1) return SendClientMessage(playerid, -1, "» "red"You cannot use this command at the moment.");
         
    if(IsPlayerInAnyVehicle(playerid))
    {
    LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
    SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), 0);
    SetVehiclePos(GetPlayerVehicleID(playerid), -1504.4640, -322.4451, 6.7357); // Change this line
    SetVehicleZAngle(GetPlayerVehicleID(playerid), 13.3832);  // Optional
    }
    else
    {
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerPos(playerid, -1514.8895,-331.4654,6.8848); // Change this line
    SetPlayerFacingAngle(playerid, 359.1662); // Optional
    }
    SendTeleportMessage(playerid, "San Fierro Airport", "sfa");
    SetCameraBehindPlayer(playerid);    
    return 1;
}
I have made some changes in your code, but it will do the same thing.
You could just to make another command like that and change the lines I have mentioned.

To get a position coordinate, type /save in game and go to your GTA-SA files > SAMP and look for a file named "savedpositions" and get the second, third and fourth paramter of the function "AddPlayerClass".

More info:

https://sampwiki.blast.hk/wiki/AddPlayerClass
Reply


Messages In This Thread
Need help with teleports - by SecretBoss - 01.01.2015, 18:59
Re: Need help with teleports - by Boot - 01.01.2015, 19:27
Re: Need help with teleports - by Neos07 - 01.01.2015, 19:31
Re: Need help with teleports - by SecretBoss - 01.01.2015, 19:39
Re: Need help with teleports - by Boot - 01.01.2015, 19:51
Re: Need help with teleports - by SecretBoss - 01.01.2015, 19:54
Re: Need help with teleports - by MohanedZzZ - 01.01.2015, 20:01
Re: Need help with teleports - by Boot - 01.01.2015, 20:06
Re: Need help with teleports - by SecretBoss - 01.01.2015, 20:11

Forum Jump:


Users browsing this thread: 3 Guest(s)