[Include] gBug - Prevent 'the G bug' - prevents players teleporting into passenger seat
#21

UPDATE: Fixed a couple of issues:

Issue #1: If you run a player over and while down they press G, OnPlayerEnterVehicle isn't called but after getting up they start to enter the vehicle. This would allow them to bypass this system, so I now detect if their special action is SPECIAL_ACTION_ENTER_VEHICLE under OnPlayerUpdate. Fixed.

Issue #2: To detect when a player starts to step in to a vehicle I detect if their velocity is 0 and their special action is SPECIAL_ACTION_ENTER_VEHICLE. It works but under specific timing conditions it may think you're stepping in when you START to run to a vehicle (when OnPlayerEnterVehicle is called) - this is now fixed by 'confirming' this event with GetTickCount. Fixed.

EDIT: Update #2: Fixed a bug where if a player entered a vehicle as a passenger but it took a while, for example he may have to run around the vehicle to get to the door on the other side, he would teleport inside and be denied entry. If the vehicle doesn't move more than 2* meters when he finally gets in, entry is now granted.

* Configurable via define in include. 2 by default. I don't recommend more than 4.
Reply
#22

Very nice! I've lol at 0:38.
Reply
#23

Nice MP2!
Reply
#24

wow thanks a lot!
Reply
#25

Thas bug is most the annoying one for me.. Good job
Reply
#26

Good job
Reply
#27

Good JoB!
Reply
#28

Quote:
Originally Posted by ******
View Post
Why not detect if they are running after a car and make them give up, rather than waiting for them to enter the vehicle then remove them again? What happens if there's already a passenger in the vehicle given that they will still warp in currently?
First of all could you clarify on 'What happens if there's already a passenger in the vehicle given that they will still warp in currently?' because I don't understand.

As for why I use this method, using a 3 second timer then failing their entry will fail most of the time due to:

1. Lag - A player starts to enter a vehicle and an un-threaded mySQL gets sent on the server, the server hangs for roughly a second - they warp in and the server doesn't detect it because they're already in.

2. Doors - Say you have a Stretch and there's 2 passengers in, one in the front passenger seat and one in the back. If you stand at the front of the bonnet and press G it will take more than 3 seconds (if not sprinting) to reach the door - causing them to warp in. I know this can be fixed by them standing at a door THEN press G, but it would piss players off.

3. They could spam G and run after it long enough to be warped in, cancelling out the timer thing

4. This is what Crazybob does, so it's not that bad.

Don't get the impression I don't like your feedback - I always look forward to your feedback because you're honest, direct and give constructive criticism. It's okay people saying 'WELL DONE GOOD WORK!!!!' but the best comments are always the criticisms - it helps you get better.
Reply
#29

i made a little thing that protected too, but it's possible to make the bug.
i used:
pawn Code:
if(ispassenger)
    {
        new Float:dx,Float:dy,Float:dz,Float:velo;
        GetPlayerPos(playerid,dx,dy,dz);
        new Float:vx,Float:vy,Float:vz;
        GetVehicleVelocity(vehicleid,vx,vy,vz);
        velo = floatround(floatsqroot(((vx*vx)+(vy*vy))+(vz*vz))*156.666667);
        if(GetDistBetweenVehiclePlayer(vehicleid,playerid) > 3 && velo >= 1.0)
        {
            SetPlayerPos(playerid, dx,dy,dz);
        }
    }
Reply
#30

Quote:
Originally Posted by MP2
View Post
First of all could you clarify on 'What happens if there's already a passenger in the vehicle given that they will still warp in currently?' because I don't understand.
If a 4-seat car is full, then I try get in and warp in to it, what happens?

Quote:
Originally Posted by MP2
View Post
As for why I use this method, using a 3 second timer then failing their entry will fail most of the time due to:

...
Check the distance the car has moved.

Quote:
Originally Posted by MP2
View Post
4. This is what Crazybob does, so it's not that bad.
Fair enough.

Quote:
Originally Posted by MP2
View Post
Don't get the impression I don't like your feedback - I always look forward to your feedback because you're honest, direct and give constructive criticism. It's okay people saying 'WELL DONE GOOD WORK!!!!' but the best comments are always the criticisms - it helps you get better.
Good, these things are good, so I will say nice work too.
Reply
#31

Quote:
Originally Posted by ******
View Post
If a 4-seat car is full, then I try get in and warp in to it, what happens?
Do you mean in SA:MP or with this include? Nothing happens with either, but OnPlayerEnterVehicle is still called.

Thanks.
Reply
#32

Very nice,brilliant idea for you to ruin us who want a free ride.

Keeping it on-topic: Keep them up.
Reply
#33

i was looking for this thanks !
Reply
#34

Very good Work!
It's the thing that SAMP Needs for years..
Reply
#35

Very Nice Release bro!!
Thanks!
Reply
#36

This is good job..
Thanks!
Reply
#37

Nice job i like it.
Reply
#38

this inc bug textdrawn in game mode ppc trucking
Reply
#39

^^

actually you installed it wrong. It works fine for me.
Reply


Forum Jump:


Users browsing this thread: 9 Guest(s)