SA-MP Forums Archive
player to player tp - 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: player to player tp (/showthread.php?tid=459837)



player to player tp - Demon4511 - 24.08.2013

anyone have a player to player teleport?
somthing like /tp %usernamehere%
and it will take you too them
(admin only)


Re: player to player tp - PaulDinam - 24.08.2013

In ZCMD:

pawn Код:
CMD:tp(playerid, params[])
{
    new id, Float:pos[3];
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a rcon admin");
    if(sscanf(params, "u", id))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /tp [playerid/PON]");
    if(!IsPlayerConnected(id))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is an invalid playerid");
    GetPlayerPos(id, pos[0], pos[1], pos[2]);
    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    SendClientMessage(playerid, COLOR_YELLOW, "Successfully teleported to your target");
    return 1;
}



Re: player to player tp - Pottus - 24.08.2013

What about virtual worlds and interiors, is the player spawned? is the player dead in a vehicle etc.


Re: player to player tp - PaulDinam - 24.08.2013

pawn Код:
CMD:tp(playerid, params[])
{
    new id, Float:pos[3];
    if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not an rcon admin");
    if(sscanf(params, "u", id))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /tp [playerid/PON]");
    if(!IsPlayerConnected(id))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is an invalid playerid");
    GetPlayerPos(id, pos[0], pos[1], pos[2]);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    SendClientMessage(playerid, COLOR_YELLOW, "Successfully teleported to your target");
    return 1;
}



Re: player to player tp - SmOkEwOw - 24.08.2013

Removed by PaulDinam is to fast oO


Re: player to player tp - Demon4511 - 24.08.2013

would you be able to give it to me in normal code or teach me how to use zcmd?
i have it but the codes that i dl'd for it dont work.


Re: player to player tp - SmOkEwOw - 24.08.2013

start with basic use strtok
https://sampwiki.blast.hk/wiki/Strtok
after go to more advanced


Re: player to player tp - Demon4511 - 24.08.2013

i was asking for the code.. i got the code but how do i use it?


Re: player to player tp - Vanter - 24.08.2013

ZCMD is a stand alone command processor, post the command at the bottom of your script


Re: player to player tp - Demon4511 - 25.08.2013

im a newbie,
that make no sence to me,
i know its a stand alone processor.
i have zcmd installed...
i have the zcmd code from above...
how do i use the code?
what is the comand