Posts: 723
Threads: 366
Joined: Jun 2016
Hi,
When i set armed weapon can i give kick if current weapo id don't mach with armed weapon?
I mean does this don't kicks players who is not cheating?
Код:
stock MySetPlayerArmedWeapon( playerid, whatweapon )
{
SetPlayerArmedWeapon( playerid, whatweapon );
if( GetPlayerWeapon( playerid ) != whatweapon )
{
Kick( playerid );
}
}
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
This will probably not work due to the way client-server communication works. If you set something you can't get it back immediately because there hasn't been any time to even send the update to the client.
Posts: 723
Threads: 366
Joined: Jun 2016
I do some test, i have deagle and m4, i use setplayerarmedweapon when with deagle to m4, it's switch my weapon to m4 and print give my 31, weapon id of m4, so it's mean working? Try your self and post results.
Posts: 3,085
Threads: 37
Joined: Nov 2012
Reputation:
0
Yes, it might work if you have a low enough ping... but when you introduce lag, desync, packetloss or simply high pings into the equation, you're going to have innocent players kicked. Not sure why holding a different weapon would even be considered cheating, but this is not the right way to approach it...
Posts: 723
Threads: 366
Joined: Jun 2016
No just setplayerarmedweapon can by off by cheats
Posts: 3,085
Threads: 37
Joined: Nov 2012
Reputation:
0
Yes, but the same can also be said about GivePlayerWeapon and SetPlayerPos and SetPlayerSkin etc. Cheaters can NOP any function they want, and just because the function didn't affect them, it doesn't mean they are cheating. Desync can also seem like functions have no affect on a player, because they often don't have any affect... You should never 'assume' when making an anti-cheat, you need to consider false positives.
SetPlayerArmedWeapon can also be 'disregarded' by simply changing your weapon.