Player to player
#1

Hey, I want a ZCMD which sends a player to another player.
But I dont know where to start, as there are 2 ID's to fill in, any help would be apreciated!

Thank you!
Reply
#2

Here:

pawn Код:
COMMAND:tele(playerid, params[])
{
    new Player1, Player2, Float:x, Float:y, Float:z, IntID, WorldID, Name[24];
   
    if (sscanf(params, "uu", Player1, Player2)) SendClientMessage(playerid, 0xFF0000AA, "[Usage]: /tele <PlayerToPort> <TargetPlayer>");
    else
    {
        if (IsPlayerConnected(Player1))
        {
            if (IsPlayerConnected(Player2))
            {
                GetPlayerName(Player2, Name, sizeof(Name));
                GetPlayerPos(Player2, x, y, z);
                IntID = GetPlayerInterior(Player2);
                WorldID = GetPlayerVirtualWorld(Player2);
                SetPlayerVirtualWorld(Player1, WorldID);
                SetPlayerInterior(Player1, IntID);
                SetPlayerPos(Player1, x, y, z + 3.0);
            }
            else
                SendClientMessage(playerid, 0xFF0000FF, "Player2 isn't online");
        }
        else
            SendClientMessage(playerid, 0xFF0000FF, "Player1 isn't online");
    }

    return 1;
}
Reply
#3

Quote:
Originally Posted by Mr.Anonymous
Посмотреть сообщение
Here:

pawn Код:
COMMAND:tele(playerid, params[])
{
    new Player1, Player2, Float:x, Float:y, Float:z, IntID, WorldID, Name[24];
   
    if (sscanf(params, "uu", Player1, Player2)) SendClientMessage(playerid, 0xFF0000AA, "[Usage]: /tele <PlayerToPort> <TargetPlayer>");
    else
    {
        if (IsPlayerConnected(Player1))
        {
            if (IsPlayerConnected(Player2))
            {
                GetPlayerName(Player2, Name, sizeof(Name));
                GetPlayerPos(Player2, x, y, z);
                IntID = GetPlayerInterior(Player2);
                WorldID = GetPlayerVirtualWorld(Player2);
                SetPlayerVirtualWorld(Player1, WorldID);
                SetPlayerInterior(Player1, IntID);
                SetPlayerPos(Player1, x, y, z + 3.0);
            }
            else
                SendClientMessage(playerid, 0xFF0000FF, "Player2 isn't online");
        }
        else
            SendClientMessage(playerid, 0xFF0000FF, "Player1 isn't online");
    }

    return 1;
}
Thanks dude!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)