Car Lock Bug? [0.3c R2-2, R3]
#1

Hey im not sure whats wrong here its just popped up from nowhere...

[ame]http://www.youtube.com/watch?v=PoYHY55PcTg[/ame]

i use, SetVehicleParamsForPlayer for my vehicle locks under OnVehicleStreamIn(vehicleid, forplayerid)

can anyone else do this when the car is locked and it has a driver?
Reply
#2

Its a samp bug. add this somewhere in your code, it should fix it.
Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetPlayerSurfingVehicleID(playerid) == vehicleid) ClearAnimations(playerid);
    return 1;
}
Reply
#3

Quote:
Originally Posted by Macluawn
View Post
Its a samp bug. add this somewhere in your code, it should fix it.
Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetPlayerSurfingVehicleID(playerid) == vehicleid) ClearAnimations(playerid);
    return 1;
}
Wow thx Macluawn, that actually looks like it would fix my problem

EDIT: It worked great thanks again Macluawn!
Reply
#4

AFAIK if you use ClearAnimations it will stop you from entering, but other players will still see you enter. Well this was the case in 0.3a and before but I don't think it was ever fixed.
Reply
#5

Quote:
Originally Posted by BeckzyBoi
View Post
AFAIK if you use ClearAnimations it will stop you from entering, but other players will still see you enter. Well this was the case in 0.3a and before but I don't think it was ever fixed.
yes that is true, so after lots of testing and mucking about i came up with this.
its not perfect but it seems my best solution atm.

Code:
}

//------------------------------------------------------------------------------------------------------
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetPlayerSurfingVehicleID(playerid) == vehicleid)
    {
		ClearAnimations(playerid);
		new Float:slx, Float:sly, Float:slz;
		GetPlayerPos(playerid, slx, sly, slz);
		SetPlayerPos(playerid, slx, sly, slz+0.1);//good results with this
    }
Reply
#6

Quote:
Originally Posted by Killa[DGZ]
View Post
//------------------------------------------------------------------------------------------------------
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if (GetPlayerSurfingVehicleID(playerid) == vehicleid)
{
ClearAnimations(playerid);
new Floatlx, Floatly, Floatlz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz+0.1);//good results with this
}
[/code]
Ar you serious, this would give more lags than simple ClearAnimation, if reciever have slow connection..
Reply
#7

Quote:
Originally Posted by GaGlets®
View Post
Ar you serious, this would give more lags than simple ClearAnimation, if reciever have slow connection..
Why lag?

It just sets the player pos.. lol.
Reply
#8

thats right moddler It just clears the animation and sets the player back on top of the car, there is no lag in that.
Though sometimes you may see the player enter as passenger for a split second (car stops - player exits) problem solved good enough for me!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)