SA-MP Forums Archive
[AJUDA] SetPlayerVelocity? ou SetVehicleVelocity - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] SetPlayerVelocity? ou SetVehicleVelocity (/showthread.php?tid=148475)



[AJUDA] SetPlayerVelocity? ou SetVehicleVelocity - BurrodaZero - 17.05.2010

Queria Saber se existe algum forma de entrar no helicуptero e jб comeзar a voar, pois tenho um sv GUERRA e os player reclamam da demora para subir e acabam morrendo, me optaram por usar esse tal de "SETPLAYERVELOCITY" ou "SetVehicleVelocity" Porйm como faz?


Re: [AJUDA] SetPlayerVelocity? ou SetVehicleVelocity - russo666 - 17.05.2010

Nunca usei o SetPlayerVelocity, mas uso isto no OnPlayerEnterVehicle:

pawn Код:
if(IsVehicleOccupied(vehicleid))
    {
        PutPlayerInVehicle(playerid, vehicleid, 1);
    }
    else
    {
        PutPlayerInVehicle(playerid, vehicleid, 0);
    }
Epб podes adaptar isto para funcionar com o Enter, etc.

pawn Код:
stock IsVehicleOccupied(vehicleid)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
    return 1;
    }
    return 0;
}
Aconselho a mudares porque senгo entras no carro mesmo com a tecla G.

E se quiseres sair mais rбpido no OnPlayerExitVehicle podes usar:

pawn Код:
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
Nгo uses assim, alteras no SetPlayerPost, metes por exemplo no X, X+2. etc.


Re: [AJUDA] SetPlayerVelocity? ou SetVehicleVelocity - SuB_ZeRo0_ - 17.05.2010

Nгo tem como eu acho.. pois SetPlayerVelocity = faz ele ir pra frente, pra tras, cair e pular.
SetVehicleVelocity msm coisa do PlayerVelocity.

=/


Re: [AJUDA] SetPlayerVelocity? ou SetVehicleVelocity - _lsd_ - 08.09.2011

Код:
Public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
	{
	        new Float:X, Float:Y, Float:Z;
  		GetVehicleVelocity(GetPlayerVehicleID(playerid),X,Y,Z);
		SetVehicleVelocity(GetPlayerVehicleID(playerid),X,Y,Z+3);
		return 1;
	}



Re: [AJUDA] SetPlayerVelocity? ou SetVehicleVelocity - [O.z]Caroline - 08.09.2011

Код:
17/05/2010, 04:44 PM	   #3
SuB_ZeRo0_
pawn Код:
08/09/2011, 09:53 PM       #4
_lsd_



Re: [AJUDA] SetPlayerVelocity? ou SetVehicleVelocity - Pharrel - 08.09.2011

Topico Fenix...renasce das cinzas...