SA-MP Forums Archive
With one command two or more people teleport - 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: With one command two or more people teleport (/showthread.php?tid=279264)



With one command two or more people teleport - pliptm - 26.08.2011

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.


Re: With one command two or more people teleport - pliptm - 26.08.2011

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


Re: With one command two or more people teleport - Kaperstone - 26.08.2011

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;
    }



Re: With one command two or more people teleport - pliptm - 26.08.2011

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


Re: With one command two or more people teleport - Kaperstone - 26.08.2011

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;
    }



Re: With one command two or more people teleport - Speed - 26.08.2011

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


Re: With one command two or more people teleport - pliptm - 26.08.2011

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.


Re: With one command two or more people teleport - pliptm - 28.08.2011

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.


Re: With one command two or more people teleport - pliptm - 29.08.2011

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


Re: With one command two or more people teleport - =WoR=Varth - 29.08.2011

What's your faction variable?