Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSI need to add something


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
  • Hi, I have this plugin that gives the last ct in life a knife with a very large dmg.
  • I wish I could give this knife to any CT alive, but it only works for me.
  • And I don't know why I can't make his dmg bigger.
  • Can anyone do this for me?
  • Thank you in advance.
PHP Code:

#pragma tabsize 0

#include <amxmodx>
#include <fun>
#include <cstrike>
#include < fakemeta >
#include <hamsandwich>

new SurvivorFound=0;
new 
bool:is_last_survivor[33] = false;
new const 
v_lamasurvivor[66] = "models/v_cutitsurvivor.mdl"
new const v_cutitdefault[66] = "models/v_knife.mdl"

public plugin_init() 
{
    
register_plugin("SERVER LAST ALIVE""2.0""LaW")
    
    
set_task 2.0"TASK_RESTRICT"___"b" );
    
register_event("HLTV""NewRound""a""1=0""2=0");
    
register_clcmd("amx_knife","adminknife");
    
RegisterHam(Ham_TakeDamage"player""fw_PlayerTakeDamage");
    
register_event"CurWeapon""CurWeapon""be""1=1" )
}

public 
plugin_precache( )
{
    
precache_model v_lamasurvivor );
}

public 
CurWeapon(id)
{
    new 
Weapon get_user_weapon(id)

    if ( 
Weapon == CSW_KNIFE && is_last_survivor[id]==true)
    {
        
set_pev(idpev_viewmodel2v_lamasurvivor);
    }
}

public 
adminknife(id)
{
    if(
get_user_flags(id) & read_flags("a"))
    {
        if(
get_user_team(id) != 2)
        {
            
client_print(idprint_console"[SERVER] U have to be CT to use this knife")
            return 
PLUGIN_HANDLED;
        }
        
is_last_survivor[id]=true;
        new 
Weapon get_user_weapon(id)

        if ( 
Weapon == CSW_KNIFE)
        {
            
set_pev(idpev_viewmodel2v_lamasurvivor);
        }
        
client_print(idprint_console"[SERVER] %s recieved a super knife")
        return 
PLUGIN_HANDLED;
    }
    else
    {
        
client_print(idprint_console"[SERVER] U dont have acces to this command")
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
public 
NewRound ( ) {
    
SurvivorFound=0;
    for(new 
id 1id <= get_maxplayers(); id++)
    {
        if(
is_user_connected(id))
        {
            
is_last_survivor[id] = false
            set_pev
(idpev_viewmodel2v_cutitdefault);
        }
    }
}

public 
TASK_RESTRICT ( ) {
    
    static 
id
    
new AliveCount
    
for(id 1id <= get_maxplayers(); id++) {
        if(
is_user_connected(id) && is_user_alive(id) && get_user_team(id) == 2) {
            
AliveCount++;
        }
    }
    
    new 
szName[32];
    for(
id 1id <= get_maxplayers(); id++)
    {
        if(
is_user_connected(id) && is_user_alive(id) && get_user_team(id) == 2)
        {
            if(
AliveCount == && SurvivorFound==0)
            {
                
SurvivorFound=1;
                
is_last_survivor[id] = true
                get_user_name
(idszNamecharsmax(szName));
                new 
Weapon get_user_weapon(id)

                if ( 
Weapon == CSW_KNIFE)
                {
                    
set_pev(idpev_viewmodel2v_lamasurvivor);
                }
                
color_chat 0"!g[SERVER]!team %s received a super knife"szName)
            }
        }
    }
    
AliveCount=0
}

public 
fw_PlayerTakeDamage(victiminflictorattackerFloat:fDamageiDamageType)
{
    if(
iDamageType DMG_GENERIC || victim == attacker || !is_user_alive(victim))
        return 
HAM_IGNORED;
    new 
Weapon get_user_weapon(attacker)
    if(
is_last_survivor[attacker] && is_user_alive(attacker))
    {
        if ( 
Weapon == CSW_KNIFE )
        {
            
fDamage *= 50;
            
//set_pev(attacker, pev_viewmodel2, v_lamasurvivor);
            
SetHamParamFloat(4fDamage);
            return 
HAM_HANDLED;
        }
    }
    return 
HAM_IGNORED;
}

stock color_chat(const id, const input[], any:...)
{
    new 
count 1Jucatori[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4"// Culoarea Verde
    
replace_all(msg190"!y""^1"// Culoarea Normala a Chat-ului (galben)
    
replace_all(msg190"!team""^3"// Culoarea Echipei : CT = Albastru | T = Rosu.
    
    
if (idJucatori[0] = id; else get_players(Jucatoricount"ch")
    {
     for (new 
0countY++)
        {
        if (
is_user_connected(Jucatori[Y]))
               {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _Jucatori[Y])
            
write_byte(Jucatori[Y]);
            
write_string(msg);
            
message_end();
            }
        }

    }


Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...