AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   not to be zombie the last CT (https://forums.alliedmods.net/showthread.php?t=229929)

JDM. 11-17-2013 05:33

not to be zombie the last CT
 
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.

Gasa 11-17-2013 23:45

Re: Kill the last CT
 
----

Backstabnoob 11-18-2013 10:39

Re: Kill the last CT
 
Quote:

Originally Posted by Gasa (Post 2062207)
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 11-18-2013 11:45

Re: Kill the last CT
 
what?

JDM. 11-18-2013 11:47

Re: Kill the last CT
 
i want to not to be zombie last ct.

Backstabnoob 11-18-2013 11:50

Re: not to be zombie the last CT
 
I wrote you a plugin that kills the last CT. Describe better what you want to do, because neither of your posts makes sense.

JDM. 11-18-2013 11:53

Re: not to be zombie the last CT
 
Yes, i know.I'm sorry for that :(

I just want not to be zombie last ct.

Backstabnoob 11-18-2013 11:57

Re: not to be zombie the last CT
 
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 ) {


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

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