player to player tp
#1

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

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;
}
Reply
#3

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

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;
}
Reply
#5

Removed by PaulDinam is to fast oO
Reply
#6

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.
Reply
#7

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

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)