Posts: 993
Threads: 86
Joined: Feb 2011
Reputation:
49
03-19-2011, 14:39
(This post was last modified: 03-19-2011, 14:40 by surtek.)
hay guy's i would like to know if you can kick someone if they use i type of gun ie
PHP Code
kickFamas() { waittill("player_shoots_famas"); dodisconect; }
??
Posts: 2,509
Threads: 96
Joined: Nov 2010
Reputation:
38
03-19-2011, 14:41
(This post was last modified: 03-19-2011, 14:43 by surtek.)
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.
Posts: 3,598
Threads: 265
Joined: Oct 2010
Reputation:
76
They check the server log for the player_killed event. That one contains the weapon.
Posts: 993
Threads: 86
Joined: Feb 2011
Reputation:
49
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?
Posts: 2,509
Threads: 96
Joined: Nov 2010
Reputation:
38
I am not sure about the modtools but it would be handy.
Posts: 4,530
Threads: 254
Joined: Nov 2010
Reputation:
65
With GSC
PHP Code: while(self getCurrentWeapon != "famas_mp") wait 0.05; //kick
Posts: 1,185
Threads: 72
Joined: Jan 2011
Reputation:
25
03-22-2011, 21:08
(This post was last modified: 03-22-2011, 21:09 by Tomsen1410.)
On _callbacksetup.gsc:
PHP 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") { "your kick function"}
[[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration); }
Posts: 3,598
Threads: 265
Joined: Oct 2010
Reputation:
76
(03-22-2011, 21:08)Tomsen1410 Wrote: On _callbacksetup.gsc:
Sounds good to me.
Posts: 993
Threads: 86
Joined: Feb 2011
Reputation:
49
03-23-2011, 02:39
(This post was last modified: 03-23-2011, 02:40 by rotceh_dnih.)
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
Posts: 5,135
Threads: 241
Joined: Nov 2010
Reputation:
100
03-23-2011, 06:39
(This post was last modified: 03-23-2011, 06:41 by Pozzuh.)
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!
|