Vehicle Teleport. -
Mr.Mafia - 05.01.2010
Hello Everyone,
I have a problem some kinda easy for pro scripters. But i tried my ass of getting it worked.
I want it like, When a player in a vehicle get to this point.
AddStaticVehicle(596,-126.1846,-3707.7759,102.6719,323.4586,0,1);
He get tped to this place.
AddStaticVehicle(596,-169.7463,-3698.6672,101.1241,257.9296,0,1);
I tried something like this,
Код:
else if (PlayerToPoint(1.0, playerid,-127.0548,-3652.8835,102.7324, cx,cy,cz))
{
//Car Parking
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(playerid, -1398.8077,-263.6243,5.7211);
}
else
{
SetPlayerPos(playerid, -1398.8077,-263.6243,5.7211);
}
SetPlayerInterior(playerid,0);
GameTextForPlayer(playerid, "~w~Car Parking", 5000, 3);
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pInt] = 0;
}
but its not working, Its like. When a player on foot get to the point. He get tped but not when hes inside the vehicle.
Please help me with this.
Re: Vehicle Teleport. -
fsnameless - 05.01.2010
pawn Код:
else if (PlayerToPoint(1.0, playerid,-127.0548,-3652.8835,102.7324, cx,cy,cz))
{
//Car Parking
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, -1398.8077,-263.6243,5.7211);
}
else
{
SetPlayerPos(playerid, -1398.8077,-263.6243,5.7211);
}
SetPlayerInterior(playerid,0);
GameTextForPlayer(playerid, "~w~Car Parking", 5000, 3);
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pInt] = 0;
}
your set VehiclePos Was getting the payers id instead of the Vehicles ID
Re: Vehicle Teleport. -
Mr.Mafia - 10.01.2010
thanks but that doesnt work as well, Cant someone please make me a simple vehicle teleport thing.
Re: Vehicle Teleport. -
Mr.Mafia - 14.01.2010
Can anyone please paste here to how make a vehicle Teleport from 1 point to another point ?
Re: Vehicle Teleport. -
TheChaoz - 14.01.2010
here u have a strcmp comand to teleport the player, and if he is in a car the car too
pawn Код:
if (!strcmp("/lv", cmdtext, true) || !strcmp("/lv", cmdtext, true) || !strcmp("/lv", cmdtext, true))
{
new Float:Health;
GetPlayerHealth(playerid, Health);
if(Health >= 70.0){
if (IsPlayerInAnyVehicle(playerid)){
SetVehiclePos(GetPlayerVehicleID(playerid),2023.5839,1545.2329,10.8205);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 0.0);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), 0);}
if (!IsPlayerInAnyVehicle(playerid)) {
SetPlayerPos(playerid, 2023.5839,1545.2329,10.8205);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);}
}else return SendClientMessage(playerid, COLOR_AMARILLO, "Server: No tienes vida suficiente para realizar este teleport");
return 1;
}
Re: Vehicle Teleport. -
Mr.Mafia - 14.01.2010
thats not helping either..