Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Anti DriverBy for NOP SetPlayerArmedWeapon
- // Steam id /zbreno1993
- #include <a_samp>
- // Detecting holding a key
- // HOLDING(keys)
- #define HOLDING(%0) \
- ((newkeys & (%0)) == (%0))
- // don't use this to ban player, exist a delay that get player armed same while the weapon has removed
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- SetPlayerArmedWeapon(playerid, 0);
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(HOLDING( KEY_FIRE ))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(GetPlayerWeapon(playerid) == 29)
- {
- Kick(playerid);
- }
- }
- }
- if(HOLDING( KEY_FIRE | KEY_LOOK_RIGHT ))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(GetPlayerWeapon(playerid) == 29)
- {
- Kick(playerid);
- }
- }
- }
- if(HOLDING( KEY_FIRE | KEY_LOOK_LEFT ))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(GetPlayerWeapon(playerid) == 29)
- {
- Kick(playerid);
- }
- }
- }
- return 1;
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- //if(IsPlayerInAnyVehicle(playerid)) Kick(playerid);
- if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) Kick(playerid);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
- {
- SetPlayerArmedWeapon(playerid, 0);
- }
- // remova se o jogador tiver sendo constantemente kickado
- // remove if player is constantly kicked
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
- {
- if(GetPlayerWeapon(playerid) != 0) Kick(playerid);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement