Teleport with vehicle
#1

Hello, when using cmd /goto ID can make teleporting and witch vehicle?

Код:
CMD:goto(playerid, params[])
{
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "SERVER: Nemas prava za koristenje ove komande.");
        new giveplayerid;
        if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_RED, "SERVER: Taj igrac nije online.");
        new Float:gotoX, Float:gotoY, Float:gotoZ;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, -1, ""COL_GREY"SERVER: Koristi /gotoid [playerid/partofname]");
        GetPlayerPos(giveplayerid, gotoX, gotoY, gotoZ);
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
        SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
        SetPlayerPos(playerid, gotoX-1, gotoY, gotoZ);
        SendClientMessage(playerid, -1, ""COL_GREY"SERVER: Teleportiro si se.");
        return 1;
}
Reply
#2

Add this:
pawn Код:
if(IsPlayerInAnyVehicle(playerid))
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        SetPlayerPos(playerid,X,Y,Z);
        SetVehiclePos(vehicleid,X,Y,Z)
        PutPlayerInVehicle(playerid,vehicleid,0);
     }
else
    {
        SetPlayerPos(playerid,X,Y,Z);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
Add this:
pawn Код:
if(IsPlayerInAnyVehicle(playerid))
{
        new vehicleid = GetPlayerVehicleID(playerid);
        SetPlayerPos(playerid,X,Y,Z);
        SetVehiclePos(vehicleid,X,Y,Z)
        PutPlayerInVehicle(playerid,vehicleid,0);
}
else
{
        SetPlayerPos(playerid,X,Y,Z);
}
    return 1;
}
ronge !

the right one is here :

pawn Код:
if(IsPlayerInAnyVehicle(playerid))
{
        new vehicleid = GetPlayerVehicleID(playerid);
        SetPlayerPos(playerid,X,Y,Z);
        SetVehiclePos(vehicleid,X,Y,Z)
        PutPlayerInVehicle(playerid,vehicleid,0);
}
else
{
        SetPlayerPos(playerid,X,Y,Z);
}
return 1;
}
Reply
#4

pawn Код:
if(IsPlayerInAnyVehicle(playerid))
{
        new vehicleid = GetPlayerVehicleID(playerid);
        SetVehiclePos(vehicleid,X,Y,Z)
}
else
{
        SetPlayerPos(playerid,X,Y,Z);
}
Reply
#5

You guys just put them same as me, saying it's wrong?
lol

trolltomax hope I helped you bro
Reply
#6

Not saying it's wrong.
Reply
#7

working,thanks JimmyCh beer for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)