Teleport problem -_-
#1

hi all...

i got more problem here....
i was trying to make an easy teleport function for my server, before, it's was just fine,but, when i tried to modify it, it was bugged i just want to teleport the player first then teleport the player's vehicle. but when the vehicle teleported, and then the player teleported too, the vehicle ome back to the previous position.

here is my code
pawn Код:
//
        new veh = GetPlayerVehicleID(playerid);
        RemovePlayerFromVehicle(playerid);
        SetTimerEx("TelePutToVeh",2000,false,"ii",playerid,veh);
        SetVehicleVirtualWorld(veh, Virtual_World);
        SetPlayerInterior(playerid, interior);
        LinkVehicleToInterior(veh, interior);
        SetVehiclePos(veh, X, Y, Z);
        SetVehicleZAngle(veh, A );
        SetPlayerPos(playerid, X, Y, Z+0.4);
        SetPlayerVirtualWorld(playerid, Virtual_World);
        SetCameraBehindPlayer(playerid);
and the TelePutToVeh

pawn Код:
public TelePutToVeh(playerid, vehicleid)
{
    PutPlayerInVehicle(playerid, vehicleid, 0);
    return 1;
}
Reply
#2

Try this
Код:
COMMAND:goto(playerid, params[])
{
new targetid;
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid,COLOR_RED,""WHITE"Usage: "GREEN"/Goto "WHITE"[id]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,COLOR_WHITE,"Please enter a player ID"RED"(Player Is Not Connected)!");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You can't use this command on yourself !");
new Float:X,Float:Y,Float:Z;new interior,world;new string[128];
GetPlayerPos(targetid,X,Y,Z);
interior = GetPlayerInterior(targetid);
world = GetPlayerVirtualWorld(targetid);
if(IsPlayerInAnyVehicle(playerid))
{
	GetPlayerName(targetid, giveplayer, sizeof(giveplayer));
	SetVehiclePos(GetPlayerVehicleID(playerid),X+5,Y+3,Z);
	new vehicle = GetPlayerVehicleID(playerid);
	LinkVehicleToInterior(vehicle,interior);
	SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), world);
}
else
{
	SetPlayerPos(playerid, X+1, Y+1, Z);
	SetPlayerInterior(playerid, interior);
	SetPlayerVirtualWorld(playerid, world);
}
new name[MAX_PLAYER_NAME];
GetPlayerName(targetid, name, sizeof(name));
format(string, sizeof(string), ""WHITE"You have Teleported to "ORANGE"\"%s's\""WHITE" Position.", name);
SendClientMessage(playerid,COLOR_WHITE, string);
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), ""ORANGE"\"%s\""WHITE" Has Teleported To Your Locations.", name);
SendClientMessage(targetid,COLOR_WHITE, string);
return 1;
}
Reply
#3

Off topic:
I love the way you guys add a smiley on the topic. And those facepalms xD...
Reply
#4

Quote:

I love the way you guys add a smiley on the topic. And those facepalms xD...

LOL
And did it work ?
Reply
#5

Quote:
Originally Posted by rockhopper
Посмотреть сообщение
LOL
And did it work ?
i didn't test your script, i already fixed it by myself

i teleported agan the vehicle before putting the player into his vehicle...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)