OnPlayerEnterVehicle Bug
Tiaansu opened this issue · comments
Describe the bug
I think there's a bug on OnPlayerEnterVehicle
on open.mp. So while trying to create an anticheat for a car toss cheat in my open.mp server, I found out that only the first nearest vehicle is getting called in OnPlayerEnterVehicle
when I try to run a car toss cheat where in SAMP, ALL nearest vehicles is getting called in OnPlayerEnterVehicle
.
To Reproduce
Steps to reproduce the behavior on open.mp server:
- Copy this code:
#include <open.mp>
main(){}
public OnGameModeInit()
{
for (new i = 0; i < 15; i ++)
{
AddStaticVehicle(460, 0.0, 0.0, 5.0, 360.0, 1, 1);
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
SendClientMessage(playerid, 0xFFFFFFFF, "DEBUG: OnPlayerEnterVehicle called for playerid %i | vehicleid | %i | ispassenger %i", playerid, vehicleid, ispassenger);
return 1;
}
-
Use any car toss cheat or I can send you the car toss cheat I'm using (it's from Blue Eclipse).. My Discord:
-
Then observe the messages from
OnPlayerEnterVehicle
when you started to use the car toss cheat.
Expected behavior
The expected behavior is to log/call ALL nearest/streamed vehicles on OnPlayerEnterVehicle
Commit hash in master
efbf6f317d1bb4f2fe50e2d8e7aa1ef8d353b296
NOTE: This also happens on latest release build and also happens when I excluded the "Fixes" component.
Here's the same reproduce script for SA-MP server so you can better observe the problem.
#include <a_samp>
main(){}
public OnGameModeInit()
{
for (new i = 0; i < 15; i ++)
{
AddStaticVehicle(460, 0.0, 0.0, 5.0, 360.0, 1, 1);
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new str[128];
format(str, sizeof str, "DEBUG: OnPlayerEnterVehicle called for playerid %i | vehicleid | %i | ispassenger %i", playerid, vehicleid, ispassenger);
SendClientMessage(playerid, 0xFFFFFFFF, str);
return 1;
}
The cheat can be the issue itself if it tries to call EnterVehicle event when the player is already in vehicle or something similar. In this case, omp server does additional validation and prevent processing invalid calls
I see. I'm going to close it now. Thanks!
This seems like a good example of why people should use omp over samp server
@PazzOnee What sync bugs are you referring to? and why are you using an unrelated issue to talk about it? If you have any issue with open.mp sync, either use our discord support channel to talk about it or create an issue for it explaining it
All these servers using open.mp and no one said it's unplayable or has bad sync.
Well, another question. If open.mp is validating and prevent processing invalid calls on events (or OnPlayerEnterVehicle), how can I create a good anti car toss anticheat? Or can you create/implement it on Nex-AC, @NexiusTailer?
Does that cheat work on open.mp? If so, the same validation should be applied more centrally in open.mp
Well, another question. If open.mp is validating and prevent processing invalid calls on events (or OnPlayerEnterVehicle), how can I create a good anti car toss anticheat? Or can you create/implement it on Nex-AC, @NexiusTailer?
Does this cheat work on the latest anticheat version? (doesn't matter on samp or omp server, this should be detected)
Well, another question. If open.mp is validating and prevent processing invalid calls on events (or OnPlayerEnterVehicle), how can I create a good anti car toss anticheat? Or can you create/implement it on Nex-AC, @NexiusTailer?
Does this cheat work on the latest anticheat version? (doesn't matter on samp or omp server, this should be detected)
I didn't tried it yet, I'm going to try it and get back to you guys.