AlliedModders

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

Mifuntm 04-04-2009 22:02

auto_restart_knives
 
I have sma 4 my own server, but i want change auto_restart (45 seconds)
only 4 "deagle" event! Someone can help and tell how to change this code?
I want just change knife to "deagle"!
Thanks!



Code:

/*
* AMX Mod X script.
* Auto restart Knives by PEREF
* Skrypt powstał na bazie skryptu Auto-Restart by VikuS
* Działa tylko pod AMXX
*
* amx_auto_rr_knives -- 1-ON 0-OFF
*
* CVAR: auto_rr_time <time> default 45
*
*/   

#include <amxmodx>
#include <amxmisc>

#define SETHUDMSG      set_hudmessage(000, 100, 255, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Niebieski
#define SETHUDMSG1      set_hudmessage(000, 205, 000, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Zielony
#define SETHUDMSG2      set_hudmessage(255, 255, 000, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Żołty
#define SETHUDMSG3      set_hudmessage(000, 255, 255, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Aqa
#define SETHUDMSG4      set_hudmessage(255, 048, 048, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Czerwony
#define SETHUDMSG5      set_hudmessage(255, 127, 000, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Pomarańczowy
#define SETHUDMSG6      set_hudmessage(238, 018, 137, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Rożowy
#define SETHUDMSG7      set_hudmessage(139, 069, 019, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Brązowy
#define SETHUDMSG8      set_hudmessage(155, 048, 255, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Fioletowy
#define SETHUDMSG9      set_hudmessage(250, 100, 100, -1.0, 0.25,  1, 0.02, 1.0, 0.01, 0.1, 1);  // (THREE TWO ONE)
#define SETHUDMSG10    set_hudmessage(250, 075, 075, -1.0, 0.25,  1, 0.02, 1.0, 0.01, 0.1, 1);  // (THREE TWO ONE)
#define LEVEL_LEVEL    ADMIN_CFG

new bool:AutoRR = true
new bool:knifeArena = false

public plugin_init()
{
    register_plugin("Auto-Restart-Knives","0.2","PEREF")
    register_dictionary("auto_restart_knives.txt")
    register_concmd("amx_auto_rr_knives","auto_rr",LEVEL_LEVEL," - 1 : ON | 0 : OFF")
    register_cvar("auto_rr_time","50")
    register_event("TextMsg","restart_time","a","2&#Game_C")
    register_event("CurWeapon","switchweapon","be","1=1","2!29")
    return PLUGIN_CONTINUE
}

public auto_rr(id)
{
    if (!(get_user_flags(id)&LEVEL_LEVEL)) {
        client_print(id, print_console, "[AMXX] %L", LANG_PLAYER, "NO_ACCESS")
       
        return PLUGIN_HANDLED
    }

    new arg [2]
    read_argv(1,arg,1)

    if(equal(arg, "1"))
    {
        AutoRR = true
        client_print(id,print_console,"[AMXX] %L", LANG_PLAYER, "ENABLED")
    }
    else if(equal(arg, "0"))
    {
        AutoRR = false
        client_print(id,print_console,"[AMXX] %L", LANG_PLAYER, "DISABLED")
    }
    else if(!equal(arg, "1") || equal(!arg, "0"))
    {
        client_print(id,print_console,"amx_auto_rr_knives 1 = On | 0 = Off");
    }
    return PLUGIN_HANDLED
 }

public switchweapon(id)
{
    if (!knifeArena)
        return PLUGIN_CONTINUE

    engclient_cmd(id,"weapon_knife")
    return PLUGIN_CONTINUE
}

public restart_time()
{
    if (AutoRR==true)
    {
        new restart_time=get_cvar_num("auto_rr_time")

        knifeArena = true
        pause("ac","M_Antirusher.amxx")

        SETHUDMSG
        show_hudmessage(0, "%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",restart_time)

        set_task(float(restart_time),"restart_map",0)
        set_task(float(restart_time)-1,"restart_1s",0)
        set_task(float(restart_time)-2,"restart_2s",0)
        set_task(float(restart_time)-3,"restart_3s",0)
        set_task(float(restart_time)-4,"restart_4s",0)
        set_task(float(restart_time)-5,"restart_5s",0)

        if (restart_time > 6)
        {
        set_task(float(restart_time)-6,"restart_6s",0)
        }
        if (restart_time > 7)
        {
        set_task(float(restart_time)-7,"restart_7s",0)
        }
        if (restart_time > 8)
        {
        set_task(float(restart_time)-8,"restart_8s",0)
        }
        if (restart_time > 9)
        {
        set_task(float(restart_time)-9,"restart_9s",0)
        }
        if (restart_time > 10)
        {
        set_task(float(restart_time)-10,"restart_10s",0)
        }
        if (restart_time > 11)
        {
        set_task(float(restart_time)-11,"restart_11s",0)
        }
        if (restart_time > 12)
        {
        set_task(float(restart_time)-12,"restart_12s",0)
        }
                if (restart_time > 13)
        {
        set_task(float(restart_time)-13,"restart_13s",0)
        }
                if (restart_time > 14)
        {
        set_task(float(restart_time)-14,"restart_14s",0)
        }
                if (restart_time > 15)
        {
        set_task(float(restart_time)-15,"restart_15s",0)
        }
                if (restart_time > 16)
        {
        set_task(float(restart_time)-16,"restart_16s",0)
        }
                if (restart_time > 17)
        {
        set_task(float(restart_time)-17,"restart_17s",0)
        }
                if (restart_time > 18)
        {
        set_task(float(restart_time)-18,"restart_18s",0)
        }
                if (restart_time > 19)
        {
        set_task(float(restart_time)-19,"restart_19s",0)
        }
                if (restart_time > 20)
        {
        set_task(float(restart_time)-20,"restart_20s",0)
        }
                if (restart_time > 21)
        {
        set_task(float(restart_time)-21,"restart_21s",0)
        }
                if (restart_time > 22)
        {
        set_task(float(restart_time)-22,"restart_22s",0)
        }
                if (restart_time > 23)
        {
        set_task(float(restart_time)-23,"restart_23s",0)
        }
                if (restart_time > 24)
        {
        set_task(float(restart_time)-24,"restart_24s",0)
        }
                if (restart_time > 25)
        {
        set_task(float(restart_time)-25,"restart_25s",0)
        }
                if (restart_time > 26)
        {
        set_task(float(restart_time)-26,"restart_26s",0)
        }
                if (restart_time > 27)
        {
        set_task(float(restart_time)-27,"restart_27s",0)
        }
                if (restart_time > 28)
        {
        set_task(float(restart_time)-28,"restart_28s",0)
        }
                if (restart_time > 29)
        {
        set_task(float(restart_time)-29,"restart_29s",0)
        }
                if (restart_time > 30)
        {
        set_task(float(restart_time)-30,"restart_30s",0)
        }
                if (restart_time > 31)
        {
        set_task(float(restart_time)-31,"restart_31s",0)
        }
                if (restart_time > 32)
        {
        set_task(float(restart_time)-32,"restart_32s",0)
        }
                if (restart_time > 33)
        {
        set_task(float(restart_time)-33,"restart_33s",0)
        }
                if (restart_time > 34)
        {
        set_task(float(restart_time)-34,"restart_34s",0)
        }
                if (restart_time > 35)
        {
        set_task(float(restart_time)-35,"restart_35s",0)
        }
                if (restart_time > 36)
        {
        set_task(float(restart_time)-36,"restart_36s",0)
        }
                if (restart_time > 37)
        {
        set_task(float(restart_time)-37,"restart_37s",0)
        }
                if (restart_time > 38)
        {
        set_task(float(restart_time)-38,"restart_38s",0)
        }
                if (restart_time > 39)
        {
        set_task(float(restart_time)-39,"restart_39s",0)
        }
                if (restart_time > 40)
        {
        set_task(float(restart_time)-40,"restart_40s",0)
        }
                if (restart_time > 41)
        {
        set_task(float(restart_time)-41,"restart_41s",0)
        }
                if (restart_time > 42)
        {
        set_task(float(restart_time)-42,"restart_42s",0)
        }
                if (restart_time > 43)
        {
        set_task(float(restart_time)-43,"restart_43s",0)
        }
                if (restart_time > 44)
        {
        set_task(float(restart_time)-44,"restart_44s",0)
        }
                if (restart_time > 45)
        {
        set_task(float(restart_time)-45,"restart_45s",0)
        }
                if (restart_time > 50)
        {
        set_task(float(restart_time)-50,"restart_50s",0)
        }
   
        }
}
public restart_50s()
{
        SETHUDMSG
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",50)
}
public restart_45s()
{
    SETHUDMSG1
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",45)
    client_cmd(0,"spk cyr4x/PaPROCH.wav")
}
public restart_44s()
{
    SETHUDMSG2
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",44)
}
public restart_43s()
{
    SETHUDMSG3
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",43)
}
public restart_42s()
{
    SETHUDMSG4
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",42)
}
public restart_41s()
{
    SETHUDMSG5
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",41)
}
public restart_40s()
{
    SETHUDMSG6
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",40)
}
public restart_39s()
{
    SETHUDMSG7
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",39)
}
public restart_38s()
{
    SETHUDMSG8
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",38)
}
public restart_37s()
{
    SETHUDMSG
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",37)
}
public restart_36s()
{
    SETHUDMSG1
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",36)
}
public restart_35s()
{
    SETHUDMSG2
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",35)
}
public restart_34s()
{
    SETHUDMSG3
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",34)
}
public restart_33s()
{
    SETHUDMSG4
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",33)
}
public restart_32s()
{
    SETHUDMSG5
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",32)
}
public restart_31s()
{
    SETHUDMSG6
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",31)
}
public restart_30s()
{
    SETHUDMSG7
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",30)
}
public restart_29s()
{
    SETHUDMSG8
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",29)
}
public restart_28s()
{
    SETHUDMSG
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",28)
}
public restart_27s()
{
    SETHUDMSG1
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",27)
}
public restart_26s()
{
    SETHUDMSG2
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",26)
}
public restart_25s()
{
    SETHUDMSG3
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",25)
}
public restart_24s()
{
    SETHUDMSG4
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",24)
}
public restart_23s()
{
    SETHUDMSG5
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",23)
}
public restart_22s()
{
    SETHUDMSG6
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",22)
}
public restart_21s()
{
    SETHUDMSG7
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",21)
}
public restart_20s()
{
    SETHUDMSG8
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",20)
}
public restart_19s()
{
    SETHUDMSG
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",19)
}
public restart_18s()
{
    SETHUDMSG1
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",18)
}
public restart_17s()
{
    SETHUDMSG2
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",17)
}
public restart_16s()
{
    SETHUDMSG3
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",16)
}
public restart_15s()
{
    SETHUDMSG4
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",15)
}
public restart_14s()
{
    SETHUDMSG5
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",14)
}
public restart_13s()
{
    SETHUDMSG6
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",13)
}
public restart_12s()
{
    SETHUDMSG7
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",12)
}
public restart_11s()
{
    SETHUDMSG8
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",11)
}
public restart_10s()
{
    SETHUDMSG
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",10)
}
public restart_9s()
{
    SETHUDMSG1
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",9)
}
public restart_8s()
{
    SETHUDMSG2
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",8)
}
public restart_7s()
{
    SETHUDMSG3
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",7)
}
public restart_6s()
{
    SETHUDMSG4
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",6)
}
public restart_5s()
{
    SETHUDMSG5
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",5)
    client_cmd(0,"")
}
public restart_4s()
{
    SETHUDMSG6
    show_hudmessage(0,"%L", LANG_PLAYER, "AUTO_RR_FOR_SEC",4)
    client_cmd(0,"")
}
public restart_3s()
{
    SETHUDMSG9
        SETHUDMSG10
    show_hudmessage(0,"%L", LANG_PLAYER, "THREE",3)
    client_cmd(0,"spk misc/three.wav")
}
public restart_2s()
{
    SETHUDMSG9
        SETHUDMSG10
    show_hudmessage(0,"%L", LANG_PLAYER, "TWO",2)
    client_cmd(0,"spk misc/two.wav")
}
public restart_1s()
{     
        SETHUDMSG9
        SETHUDMSG10
    show_hudmessage(0,"%L", LANG_PLAYER, "ONE",1)
    client_cmd(0,"spk misc/one.wav")
}

public restart_map()
{
    if (AutoRR==true)
    {
        set_cvar_float("sv_restart",1.0)
        knifeArena = false
        unpause("ac","M_Antirusher.amxx")
        set_task(2.0,"hudmess_show",0)
        SETHUDMSG9
                SETHUDMSG10
        show_hudmessage(0, "%L", LANG_PLAYER, "AUTOMATIC")
        client_cmd(0,"spk cyr4x/mifMotto.wav")
    }
}

public hudmess_show()
{
        set_hudmessage(000, 100, 255, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2)
        show_hudmessage(0, "%L", LANG_PLAYER, "NICE_GAME")
}

public plugin_precache()
{
    precache_sound( "misc/one.wav")
    precache_sound( "misc/two.wav")
    precache_sound( "misc/three.wav")
    precache_sound( "cyr4x/PaPROCH.wav")
    precache_sound( "cyr4x/mifMotto.wav")
    return PLUGIN_CONTINUE
}


TheRadiance 04-05-2009 03:16

Re: auto_restart_knives
 
Terrible code ^^
PHP Code:

/* 
* AMX Mod X script. 
* Auto restart Knives by PEREF
* Skrypt powstal na bazie skryptu Auto-Restart by VikuS
* Dziala tylko pod AMXX
*
* amx_auto_rr_knives -- 1-ON 0-OFF
*
* CVAR: auto_rr_time <time> default 45

*/    

#include <amxmodx> 
#include <amxmisc>

#define SETHUDMSG       set_hudmessage(000, 100, 255, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Niebieski
#define SETHUDMSG1      set_hudmessage(000, 205, 000, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Zielony
#define SETHUDMSG2      set_hudmessage(255, 255, 000, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Zolty
#define SETHUDMSG3      set_hudmessage(000, 255, 255, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Aqa
#define SETHUDMSG4      set_hudmessage(255, 048, 048, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Czerwony
#define SETHUDMSG5      set_hudmessage(255, 127, 000, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Pomaranczowy
#define SETHUDMSG6      set_hudmessage(238, 018, 137, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Rozowy
#define SETHUDMSG7      set_hudmessage(139, 069, 019, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Brazowy
#define SETHUDMSG8      set_hudmessage(155, 048, 255, 0.75, 0.70,  2, 0.02, 1.0, 0.01, 0.1, 1);  // Fioletowy
#define SETHUDMSG9      set_hudmessage(250, 100, 100, -1.0, 0.25,  1, 0.02, 1.0, 0.01, 0.1, 1);  // (THREE TWO ONE)
#define SETHUDMSG10     set_hudmessage(250, 075, 075, -1.0, 0.25,  1, 0.02, 1.0, 0.01, 0.1, 1);  // (THREE TWO ONE)
#define LEVEL_LEVEL    ADMIN_CFG

new bool:AutoRR true
new bool:knifeArena false

public plugin_init()
{
    
register_plugin("Auto-Restart-Knives","0.2","PEREF")
    
register_dictionary("auto_restart_knives.txt")
    
register_concmd("amx_auto_rr_knives","auto_rr",LEVEL_LEVEL," - 1 : ON | 0 : OFF")
    
register_cvar("auto_rr_time","50")
    
register_event("TextMsg","restart_time","a","2&#Game_C")
    
register_event("CurWeapon","switchweapon","be","1=1","2!26")
    return 
PLUGIN_CONTINUE
}

public 
auto_rr(id)
{
    if (!(
get_user_flags(id)&LEVEL_LEVEL)) {
        
client_print(idprint_console"[AMXX] %L"LANG_PLAYER"NO_ACCESS")
        
        return 
PLUGIN_HANDLED
    
}

    new 
arg [2]
    
read_argv(1,arg,1)

    if(
equal(arg"1"))
    {
        
AutoRR true
        client_print
(id,print_console,"[AMXX] %L"LANG_PLAYER"ENABLED")
    }
    else if(
equal(arg"0"))
    {
        
AutoRR false
        client_print
(id,print_console,"[AMXX] %L"LANG_PLAYER"DISABLED")
    }
    else if(!
equal(arg"1") || equal(!arg"0"))
    {
        
client_print(id,print_console,"amx_auto_rr_knives 1 = On | 0 = Off");
    }
    return 
PLUGIN_HANDLED
 
}

public 
switchweapon(id)
{
    if (!
knifeArena)
        return 
PLUGIN_CONTINUE

    engclient_cmd
(id,"weapon_deagle")
    return 
PLUGIN_CONTINUE
}

public 
restart_time() 
{
    if (
AutoRR==true)
    {
        new 
restart_time=get_cvar_num("auto_rr_time")

        
knifeArena true
        pause
("ac","M_Antirusher.amxx")

        
SETHUDMSG
        show_hudmessage
(0"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",restart_time)

        
set_task(float(restart_time),"restart_map",0)
        
set_task(float(restart_time)-1,"restart_1s",0)
        
set_task(float(restart_time)-2,"restart_2s",0)
        
set_task(float(restart_time)-3,"restart_3s",0)
        
set_task(float(restart_time)-4,"restart_4s",0)
        
set_task(float(restart_time)-5,"restart_5s",0)

        if (
restart_time 6)
        {
        
set_task(float(restart_time)-6,"restart_6s",0)
        }
        if (
restart_time 7)
        {
        
set_task(float(restart_time)-7,"restart_7s",0)
        }
        if (
restart_time 8)
        {
        
set_task(float(restart_time)-8,"restart_8s",0)
        }
        if (
restart_time 9)
        {
        
set_task(float(restart_time)-9,"restart_9s",0)
        }
        if (
restart_time 10)
        {
        
set_task(float(restart_time)-10,"restart_10s",0)
        }
        if (
restart_time 11)
        {
        
set_task(float(restart_time)-11,"restart_11s",0)
        }
        if (
restart_time 12)
        {
        
set_task(float(restart_time)-12,"restart_12s",0)
        }
        if (
restart_time 13)
        {
        
set_task(float(restart_time)-13,"restart_13s",0)
        }
        if (
restart_time 14)
        {
        
set_task(float(restart_time)-14,"restart_14s",0)
        }
        if (
restart_time 15)
        {
        
set_task(float(restart_time)-15,"restart_15s",0)
        }
        if (
restart_time 16)
        {
        
set_task(float(restart_time)-16,"restart_16s",0)
        }
        if (
restart_time 17)
        {
        
set_task(float(restart_time)-17,"restart_17s",0)
        }
        if (
restart_time 18)
        {
        
set_task(float(restart_time)-18,"restart_18s",0)
        }
        if (
restart_time 19)
        {
        
set_task(float(restart_time)-19,"restart_19s",0)
        }
        if (
restart_time 20)
        {
        
set_task(float(restart_time)-20,"restart_20s",0)
        }
        if (
restart_time 21)
        {
        
set_task(float(restart_time)-21,"restart_21s",0)
        }
        if (
restart_time 22)
        {
        
set_task(float(restart_time)-22,"restart_22s",0)
        }
        if (
restart_time 23)
        {
        
set_task(float(restart_time)-23,"restart_23s",0)
        }
        if (
restart_time 24)
        {
        
set_task(float(restart_time)-24,"restart_24s",0)
        }
        if (
restart_time 25)
        {
        
set_task(float(restart_time)-25,"restart_25s",0)
        }
        if (
restart_time 26)
        {
        
set_task(float(restart_time)-26,"restart_26s",0)
        }
        if (
restart_time 27)
        {
        
set_task(float(restart_time)-27,"restart_27s",0)
        }
        if (
restart_time 28)
        {
        
set_task(float(restart_time)-28,"restart_28s",0)
        }
        if (
restart_time 29)
        {
        
set_task(float(restart_time)-29,"restart_29s",0)
        }
        if (
restart_time 30)
        {
        
set_task(float(restart_time)-30,"restart_30s",0)
        }
        if (
restart_time 31)
        {
        
set_task(float(restart_time)-31,"restart_31s",0)
        }
        if (
restart_time 32)
        {
        
set_task(float(restart_time)-32,"restart_32s",0)
        }
        if (
restart_time 33)
        {
        
set_task(float(restart_time)-33,"restart_33s",0)
        }
        if (
restart_time 34)
        {
        
set_task(float(restart_time)-34,"restart_34s",0)
        }
        if (
restart_time 35)
        {
        
set_task(float(restart_time)-35,"restart_35s",0)
        }
        if (
restart_time 36)
        {
        
set_task(float(restart_time)-36,"restart_36s",0)
        }
        if (
restart_time 37)
        {
        
set_task(float(restart_time)-37,"restart_37s",0)
        }
        if (
restart_time 38)
        {
        
set_task(float(restart_time)-38,"restart_38s",0)
        }
        if (
restart_time 39)
        {
        
set_task(float(restart_time)-39,"restart_39s",0)
        }
        if (
restart_time 40)
        {
        
set_task(float(restart_time)-40,"restart_40s",0)
        }
        if (
restart_time 41)
        {
        
set_task(float(restart_time)-41,"restart_41s",0)
        }
        if (
restart_time 42)
        {
        
set_task(float(restart_time)-42,"restart_42s",0)
        }
        if (
restart_time 43)
        {
        
set_task(float(restart_time)-43,"restart_43s",0)
        }
        if (
restart_time 44)
        {
        
set_task(float(restart_time)-44,"restart_44s",0)
        }
        if (
restart_time 45)
        {
        
set_task(float(restart_time)-45,"restart_45s",0)
        }
        if (
restart_time 50)
        {
        
set_task(float(restart_time)-50,"restart_50s",0)
        }
     
    }
}
public 
restart_50s() 

    
SETHUDMSG
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",50)
}
public 
restart_45s() 

    
SETHUDMSG1 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",45)
    
client_cmd(0,"spk cyr4x/PaPROCH.wav")
}
public 
restart_44s() 

    
SETHUDMSG2 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",44)
}
public 
restart_43s() 

    
SETHUDMSG3 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",43)
}
public 
restart_42s() 

    
SETHUDMSG4 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",42)
}
public 
restart_41s() 

    
SETHUDMSG5
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",41)
}
public 
restart_40s() 

    
SETHUDMSG6
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",40)
}
public 
restart_39s() 

    
SETHUDMSG7 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",39)
}
public 
restart_38s() 

    
SETHUDMSG8 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",38)
}
public 
restart_37s() 

    
SETHUDMSG 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",37)
}
public 
restart_36s() 

    
SETHUDMSG1 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",36)
}
public 
restart_35s() 

    
SETHUDMSG2 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",35)
}
public 
restart_34s() 

    
SETHUDMSG3 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",34)
}
public 
restart_33s() 

    
SETHUDMSG4 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",33)
}
public 
restart_32s() 

    
SETHUDMSG5 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",32)
}
public 
restart_31s() 

    
SETHUDMSG6 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",31)
}
public 
restart_30s() 

    
SETHUDMSG7 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",30)
}
public 
restart_29s() 

    
SETHUDMSG8 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",29)
}
public 
restart_28s() 

    
SETHUDMSG 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",28)
}
public 
restart_27s() 

    
SETHUDMSG1 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",27)
}
public 
restart_26s() 

    
SETHUDMSG2 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",26)
}
public 
restart_25s() 

    
SETHUDMSG3 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",25)
}
public 
restart_24s() 

    
SETHUDMSG4 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",24)
}
public 
restart_23s() 

    
SETHUDMSG5
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",23)
}
public 
restart_22s() 

    
SETHUDMSG6
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",22)
}
public 
restart_21s() 

    
SETHUDMSG7 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",21)
}
public 
restart_20s() 

    
SETHUDMSG8 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",20)
}
public 
restart_19s() 

    
SETHUDMSG 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",19)
}
public 
restart_18s() 

    
SETHUDMSG1 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",18)
}
public 
restart_17s() 

    
SETHUDMSG2 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",17)
}
public 
restart_16s() 

    
SETHUDMSG3 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",16)
}
public 
restart_15s() 

    
SETHUDMSG4 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",15)
}
public 
restart_14s() 

    
SETHUDMSG5 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",14)
}
public 
restart_13s() 

    
SETHUDMSG6 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",13)
}
public 
restart_12s() 

    
SETHUDMSG7 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",12)
}
public 
restart_11s() 

    
SETHUDMSG8 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",11)
}
public 
restart_10s() 

    
SETHUDMSG 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",10)
}
public 
restart_9s() 

    
SETHUDMSG1 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",9)
}
public 
restart_8s() 

    
SETHUDMSG2 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",8)
}
public 
restart_7s() 

    
SETHUDMSG3 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",7)
}
public 
restart_6s() 

    
SETHUDMSG4 
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",6)
}
public 
restart_5s() 

    
SETHUDMSG5
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",5)
    
client_cmd(0,"")

public 
restart_4s() 

    
SETHUDMSG6
    show_hudmessage
(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",4)
    
client_cmd(0,"")

public 
restart_3s()
{
    
SETHUDMSG9
    SETHUDMSG10
    show_hudmessage
(0,"%L"LANG_PLAYER"THREE",3)
    
client_cmd(0,"spk misc/three.wav")
}
public 
restart_2s()
{
    
SETHUDMSG9
    SETHUDMSG10
    show_hudmessage
(0,"%L"LANG_PLAYER"TWO",2)
    
client_cmd(0,"spk misc/two.wav")
}
public 
restart_1s()
{       
    
SETHUDMSG9
    SETHUDMSG10
    show_hudmessage
(0,"%L"LANG_PLAYER"ONE",1)
    
client_cmd(0,"spk misc/one.wav")
}

public 
restart_map() 
{
    if (
AutoRR==true)
    {
        
set_cvar_float("sv_restart",1.0)
        
knifeArena false
        unpause
("ac","M_Antirusher.amxx")
        
set_task(2.0,"hudmess_show",0)
        
SETHUDMSG9
        SETHUDMSG10
        show_hudmessage
(0"%L"LANG_PLAYER"AUTOMATIC")
        
client_cmd(0,"spk cyr4x/mifMotto.wav")
    }
}

public 
hudmess_show()
{
        
set_hudmessage(0001002550.050.6520.026.00.010.12)
        
show_hudmessage(0"%L"LANG_PLAYER"NICE_GAME")
}

public 
plugin_precache()
{
    
precache_sound"misc/one.wav")
    
precache_sound"misc/two.wav")
    
precache_sound"misc/three.wav")
    
precache_sound"cyr4x/PaPROCH.wav")
    
precache_sound"cyr4x/mifMotto.wav")
    return 
PLUGIN_CONTINUE



fysiks 04-05-2009 11:17

Re: auto_restart_knives
 
I got bored:

PHP Code:

/* 
* AMX Mod X script. 
* Auto restart Knives by PEREF
* Skrypt powstal na bazie skryptu Auto-Restart by VikuS
* Dziala tylko pod AMXX
*
* amx_auto_rr_knives -- 1-ON 0-OFF
*
* CVAR: auto_rr_time <time> default 45

*/    

#include <amxmodx> 
#include <amxmisc>

new bool:AutoRR true
new bool:knifeArena false
new counter

// ints and floats for set_hudmessage parameters
new const Float:floats[][] =
// x,y,fxtime,holdtime,fadeintime,fadeouttime
    
{0.750.700.021.00.010.1},
    {
0.750.700.021.00.010.1},
    {
0.750.700.021.00.010.1},
    {
0.750.700.021.00.010.1},
    {
0.750.700.021.00.010.1},
    {
0.750.700.021.00.010.1},
    {
0.750.700.021.00.010.1},
    {
0.750.700.021.00.010.1},
    {
0.750.700.021.00.010.1}
}

new const 
ints[][] =
// r,g,b,effect,channel
    
{00010025521},
    {
00020500021},
    {
25525500021},
    {
00025525521},
    {
25504804821},
    {
25512700021},
    {
23801813721},
    {
13906901921},
    {
15504825521}
}

public 
plugin_init()
{
    
register_plugin("Auto-Restart-Knives","0.2","PEREF")
    
register_dictionary("auto_restart_knives.txt")
    
register_concmd("amx_auto_rr_knives","auto_rr",ADMIN_CFG," - 1 : ON | 0 : OFF")
    
register_cvar("auto_rr_time","50")
    
register_event("TextMsg","restart_time","a","2&#Game_C")
    
register_event("CurWeapon","switchweapon","be","1=1","2!26")
    return 
PLUGIN_CONTINUE
}

public 
auto_rr(idlevelcid)
{
    if(!
cmd_access(idlevelcid2))
        return 
PLUGIN_CONTINUE
    
    
new arg[2]
    
read_argv(1,arg,1)

    if(
equal(arg"1"))
    {
        
AutoRR true
        client_print
(id,print_console,"[AMXX] %L"LANG_PLAYER"ENABLED")
    }
    else if(
equal(arg"0"))
    {
        
AutoRR false
        client_print
(id,print_console,"[AMXX] %L"LANG_PLAYER"DISABLED")
    }
    else if(!
equal(arg"1") || equal(!arg"0"))
    {
        
client_print(id,print_console,"amx_auto_rr_knives 1 = On | 0 = Off");
    }
    return 
PLUGIN_HANDLED
 
}

public 
switchweapon(id)
{
    if (!
knifeArena)
        return 
PLUGIN_CONTINUE

    engclient_cmd
(id,"weapon_deagle")
    return 
PLUGIN_CONTINUE
}

public 
restart_time() 
{
    if (
AutoRR==true)
    {
        new 
counter get_cvar_num("auto_rr_time")

        
knifeArena true
        pause
("ac","M_Antirusher.amxx")

        
set_hudmessage(0001002550.750.70,  20.021.00.010.11)
        
show_hudmessage(0"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",counter)

        
set_task(1.0"seconds_func",_,_,_,"a"counter)
    }
}

public 
seconds_func()
{
    new 
counter 9

    
if( counter )
    {
        
set_hudmessage(ints[a][0],ints[a][1],ints[a][2],floats[a][0],floats[a][1],ints[a][3],floats[a][2],floats[a][3],floats[a][4],floats[a][5],ints[a][4])
        
show_hudmessage(0,"%L"LANG_PLAYER"AUTO_RR_FOR_SEC",counter)
        if( 
counter == 45 )
        {
            
client_cmd(0,"spk cyr4x/PaPROCH.wav")
        }
    }
    else
    {
        
set_hudmessage(250100100, -1.00.25,  10.021.00.010.11)

        new 
numstring[6]
        switch( 
counter )
        {
            case 
3copy(numstring5"THREE")
            case 
2copy(numstring5"TWO")
            case 
1:
            {
                
copy(numstring5"ONE")
                
set_task(1.0,"restart_map")
            }
        }
        
show_hudmessage(0,"%L"LANG_PLAYERnumstring,counter)
        
num_to_word(counternumstring5)
        
client_cmd(0,"spk fvox/%s.wav"numstring)
    }
    
counter--
}

public 
restart_map() 
{
    if (
AutoRR==true)
    {
        
set_cvar_float("sv_restart",1.0)
        
knifeArena false
        unpause
("ac","M_Antirusher.amxx")
        
set_task(2.0,"hudmess_show",0)
        
        
set_hudmessage(250100100, -1.00.25,  10.021.00.010.11)
        
show_hudmessage(0"%L"LANG_PLAYER"AUTOMATIC")
        
        
client_cmd(0,"spk cyr4x/mifMotto.wav")
    }
}

public 
hudmess_show()
{
        
set_hudmessage(0001002550.050.6520.026.00.010.12)
        
show_hudmessage(0"%L"LANG_PLAYER"NICE_GAME")
}

public 
plugin_precache()
{
    
precache_sound"misc/one.wav")
    
precache_sound"misc/two.wav")
    
precache_sound"misc/three.wav")
    
precache_sound"cyr4x/PaPROCH.wav")
    
precache_sound"cyr4x/mifMotto.wav")
    return 
PLUGIN_CONTINUE



TheRadiance 04-05-2009 11:35

Re: auto_restart_knives
 
@ fysiks
PHP Code:

register_event("CurWeapon","switchweapon","be","1=1","2!29"

:arrow:
PHP Code:

register_event("CurWeapon","switchweapon","be","1=1","2!26"


fysiks 04-05-2009 13:11

Re: auto_restart_knives
 
:), I didn't even touch that line. The only change I noticed you made was the knife -> deagle :).

Updated.

vato loco [GE-S] 04-05-2009 14:36

Re: auto_restart_knives
 
2 Attachment(s)
i was bored too :wink:

PHP Code:

/* Plugin generated by AMXX-Studio */
/* 
FAQ: 
When Setting The Value For -> amx_auto_restart <- 
Setting Value Like This amx_auto_restart "30.0" Is Correct
Setting Value Like This amx_auto_restart "30" Is Not Correct
Because The Cvar Value Is A Float
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Auto Restart Deagle vl"
#define VERSION "1.0"
#define AUTHOR "vato loco [GE-S]"

#define EXTRAOFFSET_WEAPONS    4
#define OFFSET_CLIPAMMO          51

#define TIMER_TASK        123456
#define RESTART_TASK      789123

#define ACCESS_LEVEL ADMIN_IMMUNITY

new g_counter  

new g_autorestart
new g_autoenabled

new g_SyncGameStart
new g_SyncRestartTimer

new bool:g_bRoundStart 
new bool:g_bDeagleArena

new g_iMaxPlayers

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("RoundStart"2"1=Round_Start")
    
register_event("TextMsg","RestartTask","a","2&#Game_C")   
    
register_event("CurWeapon","ForceDeagle","be","1=1","2!26")
    
    
register_concmd("amx_auto_deagle","DeagleArena",ACCESS_LEVEL,"amx_auto_deagle <1/0>")
    
    
register_dictionary("auto_rr_deagle.txt")
    
    
g_autoenabled register_cvar("amx_autorr_enable","1")
    
g_autorestart register_cvar("amx_auto_restart","45.0")
    
    
g_SyncGameStart CreateHudSyncObj()
    
g_SyncRestartTimer CreateHudSyncObj()
    
    
g_iMaxPlayers get_maxplayers()
}

public 
DeagleArena(idlvlcid
{
    if(!
cmd_access(idlvlcid2))
        return 
PLUGIN_HANDLED
    
    
new szarg[8]
    
read_argv(1,szarg,7)
    
    if(
equal(szarg,"1"))
    {
        
set_pcvar_num(g_autoenabled1)
        
client_print(0,print_chat,"%L"LANG_PLAYER"ENABLED")
    }
    else if(
equal(szarg,"0"))
    {
        
set_pcvar_num(g_autoenabled0)
        
client_print(0,print_chat,"%L"LANG_PLAYER"DISABLED")
    }
    return 
PLUGIN_HANDLED



public 
RoundStart()
{
    if(
get_pcvar_num(g_autoenabled) && g_bDeagleArena)
    {
        for(new 
<= g_iMaxPlayers i++) 
        {
            if(
is_user_connected(i) && is_user_alive(i))
            {
                
fm_strip_user_weapons(i)
                
fm_give_item(i"weapon_deagle"
                
engclient_cmd(i,"weapon_deagle")
                
                new 
weapon_id fm_find_ent_by_owner(-1"weapon_deagle"i)
                
                if(
weapon_id)
                {
                    
fm_set_weapon_ammo(weapon_id56)
                }
            }
        }
    }
    if(
g_bRoundStart)
    {
        
set_hudmessage02550, -1.00.4015.08.00.00.0, -1)
        
ShowSyncHudMsg0g_SyncGameStart"%L",LANG_PLAYER"GAME_STARTED")
    }
    
g_bRoundStart false
    
    
return PLUGIN_CONTINUE
}

public 
RestartTask() 
{
    if(
get_pcvar_num(g_autoenabled) && !g_bDeagleArena)
    {
        
pause("ac","M_Antirusher.amxx")
        
        
g_bDeagleArena true
        
        set_task
(1.0,"TimeCounter",TIMER_TASK,_,_,"a",get_pcvar_num(g_autorestart))
        
set_task(get_pcvar_float(g_autorestart),"RestartRound",RESTART_TASK)
        
    }
    return 
PLUGIN_CONTINUE
}

public 
TimeCounter() 
{
    
g_counter++
    
    new 
Float:iRestartTime get_pcvar_float(g_autorestart) - g_counter
    
new Float:fSec
    fSec 
iRestartTime 
    
    set_hudmessage
0255255, -1.00.2500.01.00.00.0, -1)
    
ShowSyncHudMsg0g_SyncRestartTimer"%L",LANG_PLAYER"AUTO_RESTART"fSec)
    
    if(
get_pcvar_num(g_autorestart) - g_counter && get_pcvar_num(g_autorestart) - g_counter !=0)
    {
        static 
szNum[32]
        
num_to_word(get_pcvar_num(g_autorestart) - g_counterszNum31)
        
client_cmd(0,"speak ^"vox/%s^""szNum)
    }
    if(
g_counter == get_pcvar_num(g_autorestart))
    {
        
g_bRoundStart true
    
}
}

public 
RestartRound() 
{
    new 
cmdrestartround[50]
    
formatex(cmdrestartround49"sv_restartround 1")
    
server_cmd(cmdrestartround)
    
    
unpause("ac","M_Antirusher.amxx")
    
    
g_bDeagleArena false
}

public 
ForceDeagle(id)

    if(
get_pcvar_num(g_autoenabled) && g_bDeagleArena)
    {
        new 
weapon_num
        weapon_num 
read_data(2)
        
        if(
weapon_num != CSW_DEAGLE
        {
            
engclient_cmd(id,"weapon_deagle")
        }
    }
    return 
PLUGIN_CONTINUE
}

stock fm_strip_user_weapons(index) {
    new 
ent fm_create_entity("player_weaponstrip")
    if (!
pev_valid(ent))
        return 
0
    
    dllfunc
(DLLFunc_Spawnent)
    
dllfunc(DLLFunc_Useentindex)
    
engfunc(EngFunc_RemoveEntityent)
    
    return 
1
}

stock fm_set_weapon_ammo(weapon_idnewammo) {    
    
    
set_pdata_int(weapon_idOFFSET_CLIPAMMOnewammoEXTRAOFFSET_WEAPONS)
}

stock fm_give_item(index, const item[]) {
    if (!
equal(item"weapon_"7) && !equal(item"ammo_"5) && !equal(item"item_"5) && !equal(item"tf_weapon_"10))
        return 
0
    
    
new ent fm_create_entity(item)
    if (!
pev_valid(ent))
        return 
0
    
    
new Float:origin[3]
    
pev(indexpev_originorigin)
    
set_pev(entpev_originorigin)
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN)
    
dllfunc(DLLFunc_Spawnent)
    
    new 
save pev(entpev_solid)
    
dllfunc(DLLFunc_Touchentindex)
    if (
pev(entpev_solid) != save)
        return 
ent
    
    engfunc
(EngFunc_RemoveEntityent)
    
    return -
1
}

stock fm_create_entity(const classname[]) {
    
    return 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringclassname)) 
}

stock fm_find_ent_by_owner(index, const classname[], ownerjghgtype 0) {
    new 
strtype[11] = "classname"ent index
    
switch (jghgtype) {
        case 
1copy(strtype6"target")
            case 
2copy(strtype10"targetname")
        }
    
    while ((
ent engfunc(EngFunc_FindEntityByStringentstrtypeclassname)) && pev(entpev_owner) != owner) {}
    
    return 
ent



fysiks 04-05-2009 14:53

Re: auto_restart_knives
 
Nice. I was only trying to duplicate his code. You made your own :). Oh, and I don't know much about CS so I only edited non-mod-specific code.

Some thoughts:

PHP Code:

if(!cmd_access(idlvlcid2))
{
    
client_print(idprint_console"%L"LANG_PLAYER"NO_ACCESS")
    
    return 
PLUGIN_HANDLED


You don't need the client_print() because cmd_access() will automatically show "no access" or "usage - blah blah".

vato loco [GE-S] 04-05-2009 14:55

Re: auto_restart_knives
 
Quote:

Originally Posted by fysiks (Post 798183)
You don't need the client_print() because cmd_access() will automatically show "no access" or "usage - blah blah".

hehe lol :mrgreen::wink: you are right...

edit: fixed :mrgreen::twisted::wink:


All times are GMT -4. The time now is 02:24.

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