Raised This Month: $ Target: $400
 0% 

not to be zombie the last CT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JDM.
Junior Member
Join Date: Nov 2013
Old 11-17-2013 , 05:33   not to be zombie the last CT
Reply With Quote #1

PHP Code:
public fwdTakeDamage(VictiminflictorAttackerFloat:damagebits) {
    if(!
is_user_alive(Victim) || !is_user_alive(Attacker)) {
        return 
HAM_IGNORED
    
}
    if(
g_zombie[Victim] && g_zombie[Attacker]) {
        return 
HAM_SUPERCEDE
    
}
    if(!
infect_allowed()) {
        
SetHamParamFloat(4damage 2
        return 
HAM_IGNORED
    
}
    if(
g_zombie[Attacker] && get_user_weapon(Attacker) == CSW_KNIFE) {
        
update_frags(Attacker1)
        
update_deaths(Victim1)

        
set_user_zombie(Victim)
    } else if(
g_zombie[Victim] && !g_zombie[Attacker]) {
        
set_pdata_float(Victim1081.050)

        static 
Float:MyOrigin[3]
        
pev(Attackerpev_originMyOrigin)

        
hook_ent2(VictimMyOrigin100.02)
    }
    if(
g_zombie[Victim]) {
        
emit_sound(VictimCHAN_VOICESounds[1],  VOL_NORMATTN_NORM0PITCH_NORM);    
    }
    return 
HAM_HANDLED
}
stock bool:infect_allowed() {  
    static 
0;  
    static 
0;  

    for(
iget_maxplayers(); i++) {  
        if((
get_user_team(i) != && get_user_team(i) != ) || !is_user_connected(i))  
        continue 
             
        
i++ 
        if(
g_zombie[i]) {  
            
j++; 
        }
    }      
    return ((
j) == 1) ? false true;  

i use this code. 1vs1 nice working but, when more than two player not working

I want to do, such as biohazard.
JDM. is offline
Gasa
Senior Member
Join Date: Sep 2013
Old 11-17-2013 , 23:45   Re: Kill the last CT
Reply With Quote #2

----

Last edited by Gasa; 11-18-2013 at 13:50. Reason: nvm as author said
Gasa is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-18-2013 , 10:39   Re: Kill the last CT
Reply With Quote #3

Quote:
Originally Posted by Gasa View Post
here and change time from when u want to start checking if one ct left to kill him
Your code is terrible.

Code:
#include < amxmodx > #include < hamsandwich > public plugin_init( ) {     RegisterHam( Ham_Killed, "player", "fw_HamKilled_Post", .Post = true ) } public fw_HamKilled_Post( iVictim ) {     new aPlayers[ 32 ], iNum     get_players( aPlayers, iNum, "ae", "CT" )         if( iNum != 1 )         return             new iLastCt = aPlayers[ 0 ]         client_print( iLastCt, print_chat, "Sorrym you're the last CT alive and need to die!" )     user_silentkill( iLastCt ) }
Backstabnoob is offline
Old 11-18-2013, 04:46
JDM.
This message has been deleted by JDM.. Reason: nvm
Old 11-18-2013, 11:22
JDM.
This message has been deleted by JDM.. Reason: nvm
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-18-2013 , 11:45   Re: Kill the last CT
Reply With Quote #6

what?
Backstabnoob is offline
JDM.
Junior Member
Join Date: Nov 2013
Old 11-18-2013 , 11:47   Re: Kill the last CT
Reply With Quote #7

i want to not to be zombie last ct.
JDM. is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-18-2013 , 11:50   Re: not to be zombie the last CT
Reply With Quote #8

I wrote you a plugin that kills the last CT. Describe better what you want to do, because neither of your posts makes sense.
Backstabnoob is offline
JDM.
Junior Member
Join Date: Nov 2013
Old 11-18-2013 , 11:53   Re: not to be zombie the last CT
Reply With Quote #9

Yes, i know.I'm sorry for that

I just want not to be zombie last ct.
JDM. is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-18-2013 , 11:57   Re: not to be zombie the last CT
Reply With Quote #10

Then create a global variable called g_iLastCt and cache the last CT's ID in it using my method and change
Code:
if(!infect_allowed()) {

to this:
Code:
if( Victim == g_iLastCt ) {

Last edited by Backstabnoob; 11-18-2013 at 11:58.
Backstabnoob is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:14.


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