vehicle&player teleport
#1

can someone make me a teleport that can tele vehicle and the players in the vehicle..
Reply
#2

pawn Код:
if ( strcmp ( cmdtext , "/teleportname", true)==0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(vehicleid, 0);
SetPlayerInterior(playerid, 0);
SetVehicleZAngle(vehicleid,0);
return SetVehiclePos(vehicleid, X,Y,Z);
}else{
SetPlayerPos(playerid, X,Y,Z);
SetPlayerInterior(playerid, 0);
}
return 1;
}
Reply
#3

doesnt work.. brackets problem L
Reply
#4

Quote:
Originally Posted by Kar
doesnt work.. brackets problem L
It works perfect for me dude, what errors do you get?
Reply
#5

this freezes when i compile

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if ( strcmp ( cmdtext , "/drift1", true)==0)
	{
	new vehicleid = GetPlayerVehicleID(playerid);
	new State = GetPlayerState(playerid);
	if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
	{
	LinkVehicleToInterior(vehicleid, 0);
	SetPlayerInterior(playerid, 0);
	SetVehicleZAngle(vehicleid,0);
	return SetVehiclePos(vehicleid, 329.3348,1536.3771,76.6117);
	}else{
	SetPlayerPos(playerid, 329.3348,1536.3771,76.6117);
	SetPlayerInterior(playerid, 0);
	}
	return 1;
}
Reply
#6

pawn Код:
if ( strcmp ( cmdtext , "/drift1", true)==0)
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    new State = GetPlayerState(playerid);
    if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
    {
    LinkVehicleToInterior(vehicleid, 0);
    SetPlayerInterior(playerid, 0);
    SetVehicleZAngle(vehicleid,0);
    SetVehiclePos(vehicleid, 329.3348,1536.3771,76.6117);
    }else{
    SetPlayerPos(playerid, 329.3348,1536.3771,76.6117);
    SetPlayerInterior(playerid, 0);
    }
    return 1;
}
Try now
Reply
#7

it works but now instead of getting teled to drift1 it teles me near area69 in the fly and i fall to death..

and i get this error "function "onplayercommandtext"should have a return value
Reply
#8

Quote:
Originally Posted by Kar
it works but now instead of getting teled to drift1 it teles me near area69 in the fly and i fall to death..

and i get this error "function "onplayercommandtext"should have a return value
You deleted something.
Also
at this line, the numbers
pawn Код:
SetPlayerPos(playerid, 329.3348,1536.3771,76.6117);
You set your own coordinates.
Reply
#9

i got rid of the error now it just teles me to the wrong place..
Reply
#10

Quote:
Originally Posted by Kar
i got rid of the error now it just teles me to the wrong place..
Seriously, do you even know how to get coordinates?

Use /save in game, go to your san andreas folder, open saveposition.txt get the coords, tha da.
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)