AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   CT teamkill (https://forums.alliedmods.net/showthread.php?t=126624)

FlyingHorse 05-11-2010 16:36

CT teamkill
 
Hello. I'm still learning coding. and i have alot to learn, But i don't know how to make this, I need a plugin for my jailbreak server that enables teamkill for CT's only.. could someone please give me the code for this

wrecked_ 05-11-2010 16:48

Re: CT teamkill
 
Code:
#include <amxmodx> #include <hamsandwich> #include <cstrike> #define IsPlayer(%1)    (1<=%1<=g_maxplayers) new g_maxplayers public plugin_init() {     register_plugin( "Team Kill - CT Only", "1.0", "Wrecked" )         RegisterHam( Ham_TakeDamage, "player", "HamTakeDamagePre", 0 )         set_pcvar_num( get_cvar_pointer( "mp_friendlyfire" ), 1 )         g_maxplayers = get_maxplayers() } public HamTakeDamagePre( victim, inflictor, attacker, Float:dmg, dmgbits ) {     return ( IsPlayer( attacker ) && ( cs_get_user_team( victim ) == CS_TEAM_T ) && ( cs_get_user_team( attacker ) == CS_TEAM_T ) )         ? HAM_SUPERCEDE;         : HAM_IGNORED; }

FlyingHorse 05-11-2010 16:49

Re: CT teamkill
 
Thank you :) i'll try it

FlyingHorse 05-31-2010 13:51

Re: CT teamkill
 
Ur code didnt work wrecked.. Didnt try it til now.. cant even compile it <.<

drekes 05-31-2010 13:59

Re: CT teamkill
 
try removing the semicolons here:

? HAM_SUPERCEDE
: HAM_IGNORED

Exolent[jNr] 05-31-2010 17:28

Re: CT teamkill
 
Quote:

Originally Posted by drekes (Post 1196356)
try removing the semicolons here:

? HAM_SUPERCEDE
: HAM_IGNORED

Only the first needed to be removed.

Code:
#include <amxmodx> #include <hamsandwich> #include <cstrike> #define IsPlayer(%1)    (1<=%1<=g_maxplayers) new g_maxplayers public plugin_init() {     register_plugin( "Team Kill - CT Only", "1.0", "Wrecked" )         RegisterHam( Ham_TakeDamage, "player", "HamTakeDamagePre", 0 )         set_pcvar_num( get_cvar_pointer( "mp_friendlyfire" ), 1 )         g_maxplayers = get_maxplayers() } public HamTakeDamagePre( victim, inflictor, attacker, Float:dmg, dmgbits ) {     return ( IsPlayer( attacker ) && ( cs_get_user_team( victim ) == CS_TEAM_T ) && ( cs_get_user_team( attacker ) == CS_TEAM_T ) )         ? HAM_SUPERCEDE         : HAM_IGNORED; }


All times are GMT -4. The time now is 03:34.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.