[HELP]Need simple teleport command! [Please]
#1

as i said tht i need a simple teleport command with vehicle tele and player tele i mean on foot and in vehicle.

i also need to know how can i make parkour teleport .. on player type /parkour1 so how can i remove him from vehicle. and set his position to co-ordinates

[Need to know the codes please ]
Reply
#2

Quote:

CMD:goto(playerid, params[])
{
new ID;//creates a new something idk what we call it :P but it is defined later on or used in something this 1 is used in next line
if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xFF0000FF, "USAGE: /goto [id]");//checks if you have written something after /goto if no it sends error
else if(!IsPlayerConnected(id) || id == playerid) return SendClientMessage(playerid, 0xFF0000FF, "This player is offline or it is yourself");//checks if the player you are teleporting to is connected or if it is yourself if yes then comes an error
else//ELSE what will happen if no errors
{
new Float, Float:y, Float:z;//creates new floats
GetPlayerPos(ID, x, y, z);//gets the player id(which we have entered after /goto position and like saves them into x,y,z defined above as floats
SetPlayerPos(playerid, x+1, y+1, z);//sets the player position the id of that player +1 in x +1 in y and z remains same as it defines height
}
return 1;
}

+REP me if i helped you.
Reply
#3

pawn Код:
CMD:goto(playerid, params[])
{
    new id, Float:X,Float:Y,Float:Z;
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /goto <playerid/name>");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "The player is offline");
    new Interior = GetPlayerInterior(id);
    SetPlayerInterior(playerid,Interior);
    SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
    GetPlayerPos(id,X,Y,Z);
    if(IsPlayerInAnyVehicle(playerid))
    {
        SetVehiclePos(GetPlayerVehicleID(playerid), X+ 1, Y+ 1, Z);
        LinkVehicleToInterior(GetPlayerVehicleID(playerid),Interior);
    }
    else SetPlayerPos(playerid, X+ 1,Y+ 1, Z);
    return 1;
}

CMD:parkour1(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        RemovePlayerFromVehicle(playerid);
    }
    SetPlayerPos(playerid, X CORDINATE, Y CORDINATE, Z CORDINATE);
    return 1;
}
Reply
#4

Quote:
Originally Posted by Affan
Посмотреть сообщение
pawn Код:
CMD:parkour1(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        RemovePlayerFromVehicle(playerid);
    }
    SetPlayerPos(playerid, X CORDINATE, Y CORDINATE, Z CORDINATE);
    return 1;
}
Thank you Affan for parkour teleport codes!

Bro!! i dnt need any /goto command .. i said i need a teleport command it means

/sf /lvair /lsair etc like this .. not player teleport
Reply
#5

Quote:
Originally Posted by NGEN123
Посмотреть сообщение
Thank you Affan for parkour teleport codes!

Bro!! i dnt need any /goto command .. i said i need a teleport command it means

/sf /lvair /lsair etc like this .. not player teleport
He provided an example on how to do it - simply copy it and edit the code for the new command names and input coordinates.
Reply
#6

pawn Код:
YCMD:goto(playerid, params[], help)
{
* * if(help)
* * {
* * * * SendClientMessage(playerid, -1, "SF | LS | LV");
* * * * SendClientMessage(playerid, -1, "/goto [Location");
* * }
* * switch ( YHash( params ), false ) //parameter | YHash(str[], bool:sensitive = true, e_HASH_TYPE:type = bernstein);
* * {
* * * * case _H<LS>:
* * * * {
* * * * * * //ls coordinates.
* * * * }
* * * * case _H<LV>:
* * * * {
* * * * * * //lv coordinates.
* * * * }
* * * * case _H<SF>:
* * * * {
* * * * * * //sf coordinates.
* * * * }
* * }

* * return 1;
}
Reply
#7

thx .. i like Affan cmd ..

Affan i was sitting on vehicle as a passenger and when i type /lvair so i teleported there with the bike and my friend also teleport there and he was driving.

Код:
CMD:lvair(playerid, params[])
{
    new id, Float:X,Float:Y,Float:Z;
    new Interior = GetPlayerInterior(id);
    if(IsPlayerInAnyVehicle(playerid))
    {
        SetVehiclePos(GetPlayerVehicleID(playerid), 1509.1740,1811.2737,10.3846);
        LinkVehicleToInterior(GetPlayerVehicleID(playerid),Interior);
    }
    else SetPlayerPos(playerid, 1537.9845,1839.4662,10.9263);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)