Coord tele
#9

Quote:
Originally Posted by Ananisiki
Посмотреть сообщение
I spawn still at blueberry acres, plz help
pawn Код:
CMD:telcoor(playerid, params[]){
        new
            Float: x,
            Float: y,
            Float: z;
           
        if(sscanf(params, "fff", x, y, z)) return SendClientMessage(playerid, -1, "USAGE: /telcoor [X] [Y] [Z]");
        if(IsPlayerInAnyVehicle(playerid)){
            new vID = GetPlayerVehicleID(playerid);
            SetVehiclePos(vID, x, y, z);
        } else {
            SetPlayerPos(playerid, x, y, z);
        }
       
        new string[256];
        format(string, sizeof(string), "Teleported to: %f, %f, %f", x, y, z);
        SendClientMessage(playerid, -1, string);
       
        return 1;
    }
Just tested it, working...

Also, to fix your code...
pawn Код:
CMD:coordteleport(playerid, params[])
{
    new Float: x, Float: y, Float: z; //---Changed to floats
    if(sscanf(params, "fff", x, y, z)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /coordteleport(XPos) (Ypos) (ZPos)"); // Changed iii to fff
    if(IsPlayerInAnyVehicle(playerid))
    {
        SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
    } else { //------------------------------------------------------------Now you wont be booted from the car
        SetPlayerPos(playerid, x, y, z);
    }
    new string[128];
    format(string, sizeof string, "You have been teleported to coordinates %f, %f, %f.", x, y, z);
    SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
}
You were getting booted from the car because you were teleporting yourself, then teleporting the car.
Reply


Messages In This Thread
Coord tele - by Ananisiki - 05.05.2014, 17:38
Re: Coord tele - by awsomedude - 05.05.2014, 18:05
Re: Coord tele - by Ananisiki - 05.05.2014, 23:11
Re: Coord tele - by awsomedude - 05.05.2014, 23:14
Re: Coord tele - by Ananisiki - 05.05.2014, 23:19
Re: Coord tele - by Jefff - 06.05.2014, 01:02
Re: Coord tele - by SickAttack - 06.05.2014, 03:07
Re: Coord tele - by Ananisiki - 06.05.2014, 23:32
Re: Coord tele - by Nathan_Taylor - 07.05.2014, 00:08
Re: Coord tele - by Aerotactics - 07.05.2014, 00:09

Forum Jump:


Users browsing this thread: 1 Guest(s)