Help problem in vehicle passenger command -
daniboi229 - 14.12.2011
this is the command it returns no errors but when i try it in-game nothing happens, it should put the player in seat id 2 of any vehicle (specificly the ones that have no passenger seat)
pawn Код:
if(strcmp( cmd, "/getin", true ) == 0 )
{
new Float:X, Float:Y, Float:Z;
new pasv;
pasv = GetVehiclePos(pasv, X, Y, Z );
IsPlayerInRangeOfPoint(playerid, 5, X, Y, Z);
PutPlayerInVehicle(playerid, pasv, 1);
return 1;
}
i just cant figure it out any help is most welcome
Re: Help problem in vehicle passenger command -
Sascha - 14.12.2011
that doesn't work on 0.3d anymore..
You can just players into vehicle seats that players can enter by default
Re: Help problem in vehicle passenger command -
daniboi229 - 14.12.2011
so if i wish to do anything like this will i have to simulate it with spectating the vehicle and putting a textlabel on the vehicle?
Re: Help problem in vehicle passenger command -
Rob_Maate - 14.12.2011
Yeah you've made an error with defining what vehicle you want.
vehicle id pasv = vehicle id pasv
That won't work xD
Try this
UNTESTED:
pawn Код:
stock IsPlayerInRangeOfVehicle(Float:radius, playerid, vehicleid)
{
if(IsPlayerConnected(playerid))
{
new Float:PX;
new Float:PY;
new Float:PZ;
new Float:X;
new Float:Y;
new Float:Z;
GetPlayerPos(playerid, PX, PY, PZ);
GetVehiclePos(vehicleid, X, Y, Z);
new Float:Distance = (X-PX)*(X-PX)+(Y-PY)*(Y-PY)+(Z-PZ)*(Z-PZ);
if(Distance <= radius * radius)
{
return 1;
}
}
return 0;
}
if(strcmp( cmd, "/getin", true ) == 0 )
{
new Float:X, Float:Y, Float:Z;
new pasv = 99999;
for(new i=0; i<MAX_VEHICLES; i++)
{
if(IsPlayerInRangeOfVehicle(3, playerid, i))
{
pasv = i;
}
}
if (pasv == 99999) return 1;
PutPlayerInVehicle(playerid, pasv, 1);
return 1;
}
Re: Help problem in vehicle passenger command -
Sascha - 14.12.2011
you can try that correct version, although it still won't work I suppose
Re: Help problem in vehicle passenger command -
daniboi229 - 14.12.2011
Quote:
Originally Posted by Rob_Maate
Yeah you've made an error with defining what vehicle you want.
vehicle id pasv = vehicle id pasv
That won't work xD
Try this
UNTESTED:
pawn Код:
stock IsPlayerInRangeOfVehicle(Float:radius, playerid, vehicleid) { if(IsPlayerConnected(playerid)) { new Float:PX; new Float:PY; new Float:PZ; new Float:X; new Float:Y; new Float:Z; GetPlayerPos(playerid, PX, PY, PZ); GetVehiclePos(vehicleid, X, Y, Z); new Float:Distance = (X-PX)*(X-PX)+(Y-PY)*(Y-PY)+(Z-PZ)*(Z-PZ); if(Distance <= radius * radius) { return 1; } } return 0; }
if(strcmp( cmd, "/getin", true ) == 0 ) { new Float:X, Float:Y, Float:Z; new pasv = 99999; for(new i=0; i<MAX_VEHICLES; i++) { if(IsPlayerInRangeOfVehicle(3, playerid, i)) { pasv = i; } } if (pasv == 99999) return 1; PutPlayerInVehicle(playerid, pasv, 1); return 1; }
|
didnt work
Re: Help problem in vehicle passenger command -
Rob_Maate - 14.12.2011
Quote:
Originally Posted by Sascha
you can try that correct version, although it still won't work I suppose
|
Why?
Check
here. There's no information or indication suggesting they've deprecated the command at all.
EDIT:
That stock needs to be placed OUTSIDE of OnPlayerCommandText().
Re: Help problem in vehicle passenger command -
daniboi229 - 14.12.2011
Quote:
Originally Posted by Rob_Maate
That stock needs to be placed OUTSIDE of OnPlayerCommandText().
|
i did place it outside of it i placed it below OnPlayerCommandText
Re: Help problem in vehicle passenger command -
Sascha - 14.12.2011
And once more:
It is not possible anymore in 0.3d to put players into a seat which they can't enter by default. Just believe me, I know what I am talking about.
Re: Help problem in vehicle passenger command -
daniboi229 - 14.12.2011
Quote:
Originally Posted by Sascha
And once more:
It is not possible anymore in 0.3d to put players into a seat which they can't enter by default. Just believe me, I know what I am talking about.
|
Yeah i know you do but i was just replying to his post & do you think there will ever be a way to put players into invalid seats released in 0.3d?