With one command two or more people teleport
#1

Is there possible to teleport with one command two or more players?
I want do some kinda police system. When officer want put player to prison, he needs to teleport. I want to do similar to next command or something like that(/teleportjail [officer id] [criminal id] ) and both persons will be teleported to cords.

Sry for super massive bad english, just quick theard.
Reply
#2

Or is there something like that you go in checkpoint and it will automatically teleport you there?
Reply
#3

Quote:
Originally Posted by pliptm
Посмотреть сообщение
Is there possible to teleport with one command two or more players?
I want do some kinda police system. When officer want put player to prison, he needs to teleport. I want to do similar to next command or something like that(/teleportjail [officer id] [criminal id] ) and both persons will be teleported to cords.

Sry for super massive bad english, just quick theard.
lol try this :
pawn Код:
#include <a_samp>
#include <zcmd>

CMD:teleportjail(playerid, params[])
{
    new
        officer,
        criminal;
    if(!sscanf(params,"rr", officer, criminal)) {
        if(!IsPlayerConnected(officer)) {
            SendClientMessage(playerid, COLOR_LIGHTRED,"This officer is not connected!");
        }
        else {
            if(!IsPlayerConnected(criminal)) {
                SendClientMessage(playerid, COLOR_LIGHTRED,"This officer is not connected!");
            }
            else {
                SetPlayerPos(criminal, X, Y, Z);  // change the X,Y,Z to the pos you want the criminal to be teleported
                SetPlayerPos(officer, X, Y, Z);   // change the X,Y,Z to the pos you want the officer to be teleported
            }
        }
        return 1;
    }
Reply
#4

Quote:
Originally Posted by xkirill
Посмотреть сообщение
lol try this :
pawn Код:
#include <a_samp>
#include <zcmd>

CMD:teleportjail(playerid, params[])
{
    new
        officer,
        criminal;
    if(!sscanf(params,"rr", officer, criminal)) {
        if(!IsPlayerConnected(officer)) {
            SendClientMessage(playerid, COLOR_LIGHTRED,"This officer is not connected!");
        }
        else {
            if(!IsPlayerConnected(criminal)) {
                SendClientMessage(playerid, COLOR_LIGHTRED,"This officer is not connected!");
            }
            else {
                SetPlayerPos(criminal, X, Y, Z);  // change the X,Y,Z to the pos you want the criminal to be teleported
                SetPlayerPos(officer, X, Y, Z);   // change the X,Y,Z to the pos you want the officer to be teleported
            }
        }
        return 1;
    }
I actually want like i insert id's like /teleportjail 1 2 ( "1" is my id and "2" is criminal/other person id) because server dosen't recognize somehow criminal and officer
Reply
#5

Quote:
Originally Posted by pliptm
Посмотреть сообщение
I actually want like i insert id's like /teleportjail 1 2 ( "1" is my id and "2" is criminal/other person id) because server dosen't recognize somehow criminal and officer
ok:
pawn Код:
CMD:teleportjail(playerid, params[])
{
    new
        criminal;
    if(!sscanf(params,"r", criminal)) {
        if(!IsPlayerConnected(criminal)) { SendClientMessage(playerid, COLOR_LIGHTRED,"This officer is not connected!"); }else{
                SetPlayerPos(criminal, X, Y, Z);  // change the X,Y,Z to the pos you want the criminal to be teleported
            }
        }else{
        SendClientMessage(playerid, COLOR_LIGHTRED,"USAGE: /teleprotjail [criminalid]
        return 1;
    }
Reply
#6

pawn Код:
CMD:teleport(playerid, params[])
{
    new id, nextid;
    if(sscanf(params, "uu", id, nextid))return SendClientMessage(playerid, -1, "Usage: /teleport [id1] [id2]");
    SetPlayerPos(id, coordinats);
    SetPlayerPos(nextid, coordinates);
    return 1;
}
now you can edit this for you....
Reply
#7

Quote:
Originally Posted by Speed
Посмотреть сообщение
pawn Код:
CMD:teleport(playerid, params[])
{
    new id, nextid;
    if(sscanf(params, "uu", id, nextid))return SendClientMessage(playerid, -1, "Usage: /teleport [id1] [id2]");
    SetPlayerPos(id, coordinats);
    SetPlayerPos(nextid, coordinates);
    return 1;
}
now you can edit this for you....
Thank you, this ones work brilliant.
I'm so thankful.
Reply
#8

Quote:
Originally Posted by Speed
Посмотреть сообщение
pawn Код:
CMD:teleport(playerid, params[])
{
    new id, nextid;
    if(sscanf(params, "uu", id, nextid))return SendClientMessage(playerid, -1, "Usage: /teleport [id1] [id2]");
    SetPlayerPos(id, coordinats);
    SetPlayerPos(nextid, coordinates);
    return 1;
}
now you can edit this for you....
Is there any way to add this in filterscript? (cuz my gamemode in in strcmp language, when i put this, and include zcmd, all other commands won't work and only this one is working..)
I tried, but my small brain just won't get it..

Edit: never mind, alraedy figured this out by myself still big thanks to you guys.. who helped me.
Reply
#9

Asking help again. Is there script or that this work only for cops?
Reply
#10

What's your faction variable?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)