Car doors not opening -
aalbero99 - 16.07.2015
Hello, I've got a little problem. I've made a system which allows the player to open a vehicle's doors if he/she has an object in their slot 3.
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/abrirvehiculo", cmdtext, true, 10) == 0)
{
if(IsPlayerNearVehicle(playerid, vt1, 10.0) && IsPlayerAttachedObjectSlotUsed(playerid, 3))
{
SetVehicleParamsForPlayer(vt1, playerid, 0, 0);
SetVehicleParamsEx(vt1, 1, 0, 0, 0, 0, 0, 0);
SendClientMessage(playerid, RED, "Has forzado la cerradura del vehiculo.");
}
return 1;
}
return 0;
}
Before doing /abrirvehiculo, the character doesn't even try to open it, all good. But after doing /abrirvehiculo with the third slot used, the car doors should be open, but the character tries to open the door instead, and it isn't open. Can aynone help me? Thanks!
Re: Car doors not opening -
notime - 16.07.2015
vt1, what is it?
Respuesta: Car doors not opening -
aalbero99 - 16.07.2015
The vehicle id, In OnGamemodeInIt I did this:
vt1 = CreateVehicle(431, 822.068603, -1636.192016, 13.390607, 120.873840, -1, -1, 0);
Re: Car doors not opening -
MasterReturnz - 16.07.2015
EDIT: Never mind you seem to have already done this.
Respuesta: Re: Car doors not opening -
aalbero99 - 16.07.2015
EDIT.
Respuesta: Car doors not opening -
aalbero99 - 16.07.2015
By the way, I did this:
SetVehicleParamsForPlayer(vt1, i, 0, 1);
In both OnVehicleSpawn and OnVehicleStreamIn.
Re: Car doors not opening -
notime - 16.07.2015
Since you have a SendClientMessage, when doing the command, does it show the Message?
If not:
Show me the definition of this:
IsPlayerNearVehicle
Respuesta: Re: Car doors not opening -
aalbero99 - 16.07.2015
Quote:
Originally Posted by notime
Since you have a SendClientMessage, when doing the command, does it show the Message?
If not:
Show me the definition of this:
IsPlayerNearVehicle
|
It shows the message, and after doing /abrirvehiculo, the character does the anim trying to open the door, which doesnt happem before doing the command.
Re: Car doors not opening -
notime - 16.07.2015
I remember something like this.
Put the SetVehicleForPlayerPArams twice in there, like this:
pawn Код:
SetVehicleParamsForPlayer(vt1, playerid, 0, 0);
SetVehicleParamsForPlayer(vt1, playerid, 0, 0);
I've had this in the past that it just doesnt open.
Respuesta: Re: Car doors not opening -
aalbero99 - 16.07.2015
Quote:
Originally Posted by notime
I remember something like this.
Put the SetVehicleForPlayerPArams twice in there, like this:
pawn Код:
SetVehicleParamsForPlayer(vt1, playerid, 0, 0); SetVehicleParamsForPlayer(vt1, playerid, 0, 0);
I've had this in the past that it just doesnt open.
|
Alright, did it and didn't work :/ I deleted the SetVehicleParamsEx though, did I have to keep it with the two SetVehicleParamsForPlayer?