Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
News ticker
  • Bienvenue sur le nouveau forum VeryGames
  • Welcome to the new VeryGames forum
  • VeryNews

    Configurer le plugin team-advantage.


    Recommended Posts

    Voici le fameux plugin:

     

    /* AMX Mod script.

    *

    * © Copyright 2004, VinZ**

    * http://Http://www.lespotos.6x.to

    * Report bugs at lespotos@keliglia.com

    *

    * CVARz :

    * tadv_mode <0=No Help 1=Dollars Help 2=Health Help>

    * tadv_losingraw <3 by default> numbers of rounds losts in a raw to give help to losing team

    * tadv_dollarraw <1000 by default> amount of dollars given by losing raw lost

    * tadv_hpraw <10 by default> amount of health given by losing raw lost

    *

    */

     

    #include <amxmodx>

    #include <cstrike>

    #include <fun>

     

    #define TS 1

    #define CTS 2

     

    new roundcount = 0

    new losingteam = 0

    new losingraw = 0

    new ct_score = 0

    new terro_score = 0

    new typaide = 0

    new cvar_losingraw

    new cvar_typaide

    new aide_dollar

    new aide_hp

    new txt_team[3][] = {"no team","terros","cts"}

     

    //pcvars

    new tadv_mode, tadv_losingraw, tadv_dollarraw, tadv_hpraw

     

    public plugin_init(){

     

    register_plugin("TeamAdvantage","0.1","VinZ**")

     

    register_event("ResetHUD", "new_round", "b")

    register_event("TextMsg","game_restart","a","1=4","2Game_C","2Game_w")

    register_event("SendAudio","team_score","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")

     

    tadv_mode = register_cvar("tadv_mode","1")

    tadv_losingraw = register_cvar("tadv_losingraw","3")

    tadv_dollarraw = register_cvar("tadv_dollarraw","1000")

    tadv_hpraw = register_cvar("tadv_hpraw","10")

     

    return PLUGIN_CONTINUE

    }

     

    public team_score(){

     

    new team[64], oldlosingteam = losingteam

     

    roundcount++

     

    typaide = 0

    cvar_typaide = get_pcvar_num(tadv_mode)

    cvar_losingraw = get_pcvar_num(tadv_losingraw)

     

    read_data(2,team,63)

     

    if (containi(team,"ctwin")!=-1){

    ct_score++

    losingteam = TS

    }else if (containi(team,"terwin")!=-1) {

    terro_score++

    losingteam = CTS

    } else if (containi(team,"draw")!=-1) {

    losingteam = oldlosingteam

    }

     

    new teamwonbyscore = wonbyscore(ct_score,terro_score)

    if (teamwonbyscore==0 || teamwonbyscore==losingteam){

    losingraw = 0

    losingteam = 0

    }

     

    if (oldlosingteam == losingteam)

    losingraw++

    else if (oldlosingteam != losingteam)

    losingraw = 0

     

    affichscore()

     

    if ((losingraw + 1) >= cvar_losingraw && cvar_typaide != 0 && losingteam != 0){

     

    typaide = cvar_typaide

     

    if (typaide == 1){

    aide_dollar = minval(get_pcvar_num(tadv_dollarraw) * ((losingraw + 2) - cvar_losingraw),16000)

    client_print(0,print_chat,"* les %s perdent de trop. Aide de %d$",txt_team[losingteam],aide_dollar)

    }else{ // hp

    aide_hp = minval(get_pcvar_num(tadv_hpraw) * ((losingraw + 2) - cvar_losingraw),100)

    client_print(0,print_chat,"* les %s perdent de trop. Aide de %dhp",txt_team[losingteam],aide_hp)

    }

     

    }

     

    return PLUGIN_CONTINUE

     

    }

     

    public game_restart(){

    roundcount = 0

    losingteam = 0

    losingraw = 0

    ct_score = 0

    terro_score = 0

    typaide = 0

    affichscore()

    }

     

    public new_round(id){

     

    if (typaide == 0)

    return PLUGIN_CONTINUE

     

    if (get_user_team(id) == losingteam){

     

    new parm[2]

     

    parm[0] = id

     

    set_task(0.5,"donneaide",id+3213,parm,2)

     

    }

     

    return PLUGIN_CONTINUE

    }

     

    public donneaide(parm[]){

     

    new id = parm[0]

     

    if (typaide == 1){//argent

     

    cs_set_user_money(id,min(aide_dollar + cs_get_user_money(id),16000))

     

    }else{ // hp

     

    set_user_health(id,min(aide_hp + get_user_health(id),200))

     

    }

    }

     

    minval(a,b){

    if (a < b)

    return a

    else if (b < a)

    return b

     

    return a

    }

     

    wonbyscore(ct,terro){

    if (ct > terro)

    return CTS

    else if (terro > ct)

    return TS

     

    return 0

    }

    /*

    debugit(name[],value[])

    client_print(0,print_chat,"[DEBUG] %s = %s",name,value)

     

    debugiti(name[],value)

    client_print(0,print_chat,"[DEBUG] %s = %d",name,value)

    */

    affichscore()

    client_print(0,print_chat,"[scoRe RouNd %d] CTs=%d Terros=%d", roundcount, ct_score, terro_score)

     

     

     

     

     

    Ma question est (avant de le compiler) : Que dois-je changer comme valeur pour que lorsqu'une équipe perd 3 round d’affiler un bonus de 1000$ lui soit versé au début des round tant que l'équipe n'a pas gagner de round?

     

    Merci d'avance

    Link to post
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...