SA-MP Forums Archive
teleport with vehicle help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: teleport with vehicle help (/showthread.php?tid=148243)



teleport with vehicle help - Kar - 16.05.2010

this doesnt work
Код:
if(strcmp(cmdtext,"/FH",true)==0)
{
	new vehicleid = GetPlayerVehicleID(playerid);
	new State = GetPlayerState(playerid);
	if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
	{
	return SetVehiclePos(vehicleid,846.4355,-2024.6938,12.5638);
	}
	SetPlayerPos(playerid,844.7284,-2024.2441,12.8672);
	return 1;
}
this doesnt either
Код:
if(strcmp(cmdtext, "/drift1", true)==0) //if player types /teleport
{
    if(IsPlayerInAnyVehicle(playerid)) //if player is in any vehicle
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) //if player state = driver
        {
            SetVehiclePos(GetPlayerVehicleID(playerid), -358.1943,1531.2909,75.1698 ); //set vehicle pos
            SetVehicleZAngle(GetPlayerVehicleID(playerid), 264.7289); //set vehicle ang
            SetCameraBehindPlayer(playerid); //set camera behind player

        }
        else //player is not the driver
        {
            SendClientMessage(playerid,0xFFFF00AA, "ERROR: You need to be the driver!");
        }
    }
    else //player is not in any vehicle
    {
        SetPlayerPos(playerid, -329.3348,1536.3771,76.6117 ); //set player pos
        SetPlayerFacingAngle(playerid, 276.8851); //set player facing ang
        SetCameraBehindPlayer(playerid); //set camera behind the player
    }
    return 1;
}
help D: they give me alot of errors


Re: teleport with vehicle help - juice.j - 16.05.2010

What are the errors?


Re: teleport with vehicle help - Kar - 16.05.2010

errors


Re: teleport with vehicle help - juice.j - 16.05.2010

Most likely you mix up your brackets somewhere, meaning you forget to close one or close not on purpose. Just assuming tho'


Re: teleport with vehicle help - Kar - 16.05.2010

could u give me a teleport then?


Re: teleport with vehicle help - juice.j - 16.05.2010

Somewhere above your command you either do not close all brackets supposed be closed or you do close one which is not supposed to be closed.

That has nothing to do with your teleport command as such.