How to make Player TELE to others Place +REP ?
#1

Hello
Can i ask ?
How to make player tele to other place ?
But with admin commands.

Example :

/teleplayer <id> <place>

Because on my server just admin can teleport
The problem is, much player want to teleport to bank with fast.

But i dont want to make teleport system to other player.
because it will make abuse. example : On Death Match player will tele to bank, for run . So i want just admin can make player tele

Please help me
Reply
#2

Ofcourse You can co do that.

pawn Код:
CMD:teleplayer(playerid, params[])
{
    new id;
    new PlayerName[24], str_[62];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED1,"[ ! ] USAGE: /teleplayer <playerid> <placename>");
    format(str_, sizeof(str_), "[ ! ] %s has teleported you !", PlayerName);
    SendClientMessage(id, COLOR_RED1, str_);
    SetPlayerPos(id, 1721.9911,-1608.1677,13.5469); //Change X,Y,Z Co-ordinates to what place you want the player to be teleported and type /save
    SetPlayerInterior(id, 0); //Change Interiors....(Check Interiors where you do /save by doing /interior or Search in ******.
// Add more Places here...and name them as you want...
    return 1;
}
If I help you so Please +rep
Reply
#3

Quote:
Originally Posted by MAFIAWARS
Посмотреть сообщение
Ofcourse You can co do that.

pawn Код:
CMD:teleplayer(playerid, params[])
{
    new id;
    new PlayerName[24], str_[62];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED1,"[ ! ] USAGE: /teleplayer <playerid> <placename>");
    format(str_, sizeof(str_), "[ ! ] %s has teleported you !", PlayerName);
    SendClientMessage(id, COLOR_RED1, str_);
    SetPlayerPos(id, 1721.9911,-1608.1677,13.5469); //Change X,Y,Z Co-ordinates to what place you want the player to be teleported and type /save
    SetPlayerInterior(id, 0); //Change Interiors....(Check Interiors where you do /save by doing /interior or Search in ******.
// Add more Places here...and name them as you want...
    return 1;
}
If I help you so Please +rep
That'll make every player able to use it, Which he doesn't want...

Okay there are two ways,
1.you can save the Bank's X,Y,Z on the gang and then put it on the script and do it to teleport the player to that position...
2.Or to type the coords on the command ingame, What way would you like ?

If the first one, Then MAFIAWARS's command would be good,
But you'll need to add the stuff to make only admins able to do it, I edit it for you

pawn Код:
CMD:teleplayer(playerid, params[])
{
    if(IsPlayerAdmin(playerid))// Edit this to work with your admin system, If you have one..
    {
        new id;
        new PlayerName[24], str_[62];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED1,"USAGE: /teleplayer <playerid> <placename>");
        format(str_, sizeof(str_), "%s has teleported you !", PlayerName);
        SendClientMessage(id, COLOR_RED1, str_);
        SetPlayerPos(id, 1721.9911,-1608.1677,13.5469); //Change X,Y,Z Co-ordinates to what place you want the player to be teleported and type /save
        SetPlayerInterior(id, 0); //Change Interiors....(Check Interiors where you do /save by doing /interior or Search in ******.
    }
    return 1;
}
}
Reply
#4

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
That'll make every player able to use it, Which he doesn't want...

Okay there are two ways,
1.you can save the Bank's X,Y,Z on the gang and then put it on the script and do it to teleport the player to that position...
2.Or to type the coords on the command ingame, What way would you like ?

If the first one, Then MAFIAWARS's command would be good,
But you'll need to add the stuff to make only admins able to do it, I edit it for you

pawn Код:
CMD:teleplayer(playerid, params[])
{
CMD:teleplayer(playerid, params[])
{
    if(IsPlayerAdmin(playerid))// Edit this to work with your admin system, If you have one..
    {
        new id;
        new PlayerName[24], str_[62];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED1,"USAGE: /teleplayer <playerid> <placename>");
        format(str_, sizeof(str_), "%s has teleported you !", PlayerName);
        SendClientMessage(id, COLOR_RED1, str_);
        SetPlayerPos(id, 1721.9911,-1608.1677,13.5469); //Change X,Y,Z Co-ordinates to what place you want the player to be teleported and type /save
        SetPlayerInterior(id, 0); //Change Interiors....(Check Interiors where you do /save by doing /interior or Search in ******.
    }
    return 1;
}
}
I don't know its Player Information and Admin System, That is why I didn't put...
Reply
#5

Quote:

I don't know its Player Information and Admin System, That is why I didn't put...

Then at least tell him that..
Reply
#6

Just make places and name them so u can use them in your /teleplayer cmd
Reply
#7

Here:

pawn Код:
CMD:teleplayer(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You're not authorized to use this command."); // change this to your own admin variable that you're using
    new giveplayerid, place[50];
    if(sscanf(params, "us[50]", giveplayerid, place))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Correct usage: /teleplayer [playerid/name] [place]");
        SendClientMessage(playerid, 0xFFFFFFFF, "Available places are: bank, lspd"); // add your own here
        return 1;
    }
    if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "Error: Player not connected.");
    if(strcmp(place, "bank"))
    {
        SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the bank's X Y and Z
    }
    else if(strcmp(place, "lspd"))
    {
        SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the lspd's X Y and Z
    }
    else
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Error: Invalid teleport place.");
        SendClientMessage(playerid, 0xFFFFFFFF, "Available places are: bank, lspd"); // add your own here
    }
    return 1;
}
To add more places, you simply add this:

pawn Код:
else if(strcmp(place, "newplace"))
{
    SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the new place's X Y and Z
}
Underneath the last else if, so then it'd look like this:

pawn Код:
CMD:teleplayer(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return 0; // change this to your own admin variable that you're using
    new giveplayerid, place[50];
    if(sscanf(params, "us[50]", giveplayerid, place))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Correct usage: /teleplayer [playerid/name] [place]");
        SendClientMessage(playerid, 0xFFFFFFFF, "Available places are: bank, lspd"); // add your own here
        return 1;
    }
    if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "Error: Player not connected.");
    if(strcmp(place, "bank"))
    {
        SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the bank's X Y and Z
    }
    else if(strcmp(place, "lspd"))
    {
        SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the lspd's X Y and Z
    }
    else if(strcmp(place, "newplace"))
    {
        SetPlayerPos(giveplayerid, 0.0, 0.0, 0.0); // replace the 0.0's with the new place's X Y and Z
    }
    else
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "Error: Invalid teleport place.");
        SendClientMessage(playerid, 0xFFFFFFFF, "Available places are: bank, lspd"); // add your own here
    }
    return 1;
}
Reply
#8

pawn Код:
CMD:sendtobank(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 3)
    {
        new string[128], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "PEMAKAIAN: /sendtobank [playerid]");

        if(IsPlayerConnected(giveplayerid))
        {
            if (PlayerInfo[giveplayerid][pAdmin] >= )//Here Your Admin Level
            {
                SendClientMessageEx(playerid, COLOR_GRAD1, "Anda tidak cukup level admin untuk menggunakan perintah ini!");
                return 1;
            }
            format(string, sizeof(string), " Anda telah mengirim %s Ke Bank.", GetPlayerNameEx(giveplayerid));
            SendClientMessageEx(playerid, COLOR_WHITE, string);
            SendClientMessageEx(giveplayerid, COLOR_GRAD1, "   Anda telah di teleportasi ke Bank!");
            SetPlayerPos(giveplayerid, //YOUR COORDINAT HERE);
            SetPlayerVirtualWorld(giveplayerid, 0);
            SetPlayerInterior(giveplayerid, 0);
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "Anda tidak memiliki wewenang untuk menggunakan perintah ini!");
    }
    return 1;
}
Here you are , , SetPlayerPos(playerid, //YOURCOORDINATHERE);
How to make coordinnat ? stand on your coordinat after it /save
Reply
#9

Quote:
Originally Posted by HolyScripter
Посмотреть сообщение
pawn Код:
CMD:teleplayer(playerid, params[])
{
    new giveplayerid;
    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotoid [playerid]");

    new Float:plocx,Float:plocy,Float:plocz;
    if (IsPlayerConnected(giveplayerid))
    {
            GetPlayerPos(giveplayerid, plocx, plocy, plocz);
            SetPlayerVirtualWorld(playerid, PlayerInfo[giveplayerid][pVW]);
            Streamer_UpdateEx(playerid, plocx, plocy, plocz);

            if (GetPlayerState(playerid) == 2)
            {
                new tmpcar = GetPlayerVehicleID(playerid);
                SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
                TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
            }
            else
            {
                SetPlayerPos(playerid,plocx,plocy+2, plocz);
                SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
                SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
            }

            SendClientMessage(playerid, COLOR_GRAD1, "   You have been teleported!");
        }

    }
    else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
    return 1;
}
Here you are ,
Last post was nearly a week ago, and the last post was telling the person exactly what he wanted, i.e. a /teleplayer [playerid] [place]. Your command's not even fitting the needs of what the guy wants. Anyway, be a bit more careful next time before you post and check the dates.
Reply
#10

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
Last post was nearly a week ago, and the last post was telling the person exactly what he wanted, i.e. a /teleplayer [playerid] [place]. Your command's not even fitting the needs of what the guy wants. Anyway, be a bit more careful next time before you post and check the dates.
i dont know what he says , goto to player or goto to place or teleport player to place , so i got confused so i edit the script again hahaha
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)