Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request Kick on certan weapon's?
#1
hay guy's i would like to know if you can kick someone if they use i type of gun ie

PHP Code
  1. kickFamas()
  2. {
  3. waittill("player_shoots_famas");
  4.  
  5. dodisconect;
  6. }


??
Reply

#2
Edit: added code tags.

@Topicstarter: It is possible on server when someone for example uses a claymore. You won't be kicked if you aren't using it, but when you are you will get a kick. Don't know if it works with alter recon or something or with standard one.
Reply

#3
They check the server log for the player_killed event. That one contains the weapon.
Reply

#4
yea i think the alterrcon checks the chat log but thats from gameservers
i would like to find a way do just set banned weapons in a mod for private hosting ,
but when the mod tools come it should be easy to make a mod that will do this?
Reply

#5
I am not sure about the modtools but it would be handy.
Reply

#6
With GSC

PHP Code:
while(self getCurrentWeapon != "famas_mp")
wait 0.05;
//kick 
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

#7
On _callbacksetup.gsc:

PHP Code:
/*================
Called when a player has been killed.
self is the player that was killed.
================*/
CodeCallback_PlayerKilled(eInflictoreAttackeriDamagesMeansOfDeathsWeaponvDirsHitLoctimeOffsetdeathAnimDuration)
{
    
self endon("disconnect");
        if(
sWeapon(eAttacker) == "famas_mp")
                { 
"your kick function"}


    
    [[
level.callbackPlayerKilled]](eInflictoreAttackeriDamagesMeansOfDeathsWeaponvDirsHitLoctimeOffsetdeathAnimDuration);

Reply

#8
(03-22-2011, 21:08)Tomsen1410 Wrote: On _callbacksetup.gsc:

PHP Code:
... 

Sounds good to me.
Reply

#9
look's good replaced that part in callbacksetup with your's but when i try i get error unknown funtion, must i have to call the CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration) at _rank.gsc?
Here's my code oh and i dont know the kick funtion so for now it's just a message
Code:
/*================
Called when a player has been killed.
self is the player that was killed.
================*/
CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration)
{
    self endon("disconnect");
        if(sWeapon(eAttacker ) == "famas_mp")
self iPrintlnBold("^1You can not have that weapon silly");
          
    [[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);
}
i also tried with out the iprintlnbold with the same error that's why i think maybe im not doing something right or there is maybe a error in the syntax, more then likely im stuffing it up coz i've only been codeing for 3 week's lol
Reply

#10
Because you can't just edit the callbackSETUP you need to edit the callback.

Open _globallogic_player.gsc and search for callback_playerdamage.
Code:
Callback_PlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime )
{
    // create a class specialty checks; CAC:bulletdamage, CAC:armorvest
    iDamage = maps\mp\gametypes\_class::cac_modified_damage( self, eAttacker, iDamage, sMeansOfDeath, sWeapon, eInflictor, sHitLoc );
    iDamage = custom_gamemodes_modified_damage( self, eAttacker, iDamage, sMeansOfDeath, sWeapon, eInflictor, sHitLoc );
    
    iDamage = int(iDamage);
    self.iDFlags = iDFlags;
    self.iDFlagsTime = getTime();

    if ( game["state"] == "postgame" )
        return;
    
    if ( self.sessionteam == "spectator" )
        return;
    
    if ( isDefined( self.canDoCombat ) && !self.canDoCombat )
        return;
    
    if ( isDefined( eAttacker ) && isPlayer( eAttacker ) && isDefined( eAttacker.canDoCombat ) && !eAttacker.canDoCombat )
        return;
    
    if ( isDefined( level.hostMigrationTimer ) )
        return;
        
    if(eAttacker.sWeapon == "famas_mp")
    {
        eAttacker IPrintLnBold( "Your bullets didn't do anything, ^1BECAUSE YOU'RE USING A NOOB WEAPON!" );
        return; //return makes the function stop, so no damage.
    }

//Rest of the function here!
[Image: MaEIQ.png]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 4,162 11-09-2013, 09:21
Last Post: clemi555
Question Help Mw2 weapon skin question FroxIVx4 1 2,950 10-13-2013, 16:54
Last Post: hmann
Question Help Weapon Name iRoNinja 8 6,584 10-08-2013, 08:31
Last Post: iRoNinja
  Mw2 weapon porting? Cuddlyedits 3 4,734 09-15-2013, 16:43
Last Post: DidUknowiPwn
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,271 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,737 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Mw2 weapon skin question FroxIVx4 1 2,921 07-06-2013, 19:22
Last Post: surtek
  [Request] List of all weapon models DidUknowiPwn 3 4,628 04-20-2013, 09:13
Last Post: Dominator56
  [Release] !weapon Plugin 8q4s8 40 25,626 03-24-2013, 17:02
Last Post: X-Track
  [Release] Black Ops ZM & MP weapon ID's JariZ 7 30,979 03-01-2013, 22:04
Last Post: JariZ

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.