User
Pass
2FA
 
 

Problema plugin Vip

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support
Author Message722
detalex11

[Mentally Stable]



Status: Offline
(since 09-05-2019 18:20)
Joined: 23 Oct 2016
Posts: 26, Topics: 5
Location: Romania

Reputation: 67.9
Votes: 1

Post Posted: 25-04-2017, 10:42:28 | Translate post to: ... (Click for more languages)

»Nume*: Vip 3 nivele
»Descriere problema*:Serveru e de respawn functioneaza totul bine daor ca nustiu din ce motiv dupa un frag moare si cel cu beneficiu am dat si debug dar nu am rezolvat si nici eroarea nu gasesc iar in logs asta da "committed suicide "
»Poze/Sma:

Code:

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

#define GOLD_MEMBER         ADMIN_LEVEL_F
#define PLATINUM_MEMBER        ADMIN_LEVEL_G
#define DIAMOND_MEMBER        ADMIN_LEVEL_H
#define GOLD_MEMBER_HP_SPAWN        110
#define PLATINUM_MEMBER_HP_SPAWN     120
#define DIAMOND_MEMBER_HP_SPAWN     135
#define GOLD_MEMBER_SPEED_SPAWN        310.0
#define PLATINUM_MEMBER_SPEED_SPAWN     325.0
#define DIAMOND_MEMBER_SPEED_SPAWN     350.0


new health_add_gold
new health_add_knife_gold
new armor_add_gold
new armor_add_knife_gold
new health_hs_add_gold
new armor_hs_add_gold
new health_max_gold
new armor_max_gold
new health_max_platinum
new armor_max_platinum
new health_add_platinum
new health_add_knife_platinum
new armor_add_platinum
new armor_add_knife_platinum
new health_hs_add_platinum
new armor_hs_add_platinum
new health_max_diamond
new armor_max_diamond
new health_add_diamond
new health_add_knife_diamond
new armor_add_diamond
new armor_add_knife_diamond
new health_hs_add_diamond
new armor_hs_add_diamond
new nKiller
new nKiller_hp
new nKiller_ap
new nHp_add
new nAp_add
new nHp_max
new nAp_max
new weapon
new g_iMaxPlayers
new g_iPrevCurWeapon[33]
new diamond_visibility


public plugin_init()
{   
    register_plugin("VIP 3 Nivele", "1.0", "Alexandru")
    diamond_visibility = register_cvar("amx_vip_invis" , "125")
    health_add_gold = register_cvar("amx_gold_hp_kill" , "10")
    health_add_platinum = register_cvar("amx_platinum_hp_kill" , "15")
    health_add_diamond = register_cvar("amx_diamond_hp_kill" , "25")
    health_hs_add_gold = register_cvar("amx_gold_hp_hs_kill" , "15")
    health_hs_add_platinum = register_cvar("amx_platinum_hp_hs_kill" , "20")
    health_hs_add_diamond = register_cvar("amx_diamond_hp_hs_kill" , "30")
    health_max_gold = register_cvar("amx_gold_max_health" , "120")
    health_max_platinum = register_cvar("amx_platinum_max_health" , "135")
    health_max_diamond = register_cvar("amx_diamond_max_health" , "150")
    armor_max_gold = register_cvar("amx_gold_max_armor" , "120")
    armor_max_platinum = register_cvar("amx_platinum_max_armor" , "150")
    armor_max_diamond = register_cvar("amx_diamond_max_armor" , "200")
    armor_add_gold = register_cvar("amx_gold_armor_kill" , "10")
    armor_add_platinum = register_cvar("amx_platinum_armor_kill" , "15")
    armor_add_diamond = register_cvar("amx_diamond_armor_kill" , "25")
    armor_hs_add_gold = register_cvar("amx_gold_armor_hs_kill" , "15")
    armor_hs_add_platinum = register_cvar("amx_platinum_armor_hs_kill" , "20")
    armor_hs_add_diamond = register_cvar("amx_diamond_armor_hs_kill" , "30")
   
    health_add_knife_gold = register_cvar("amx_gold_health_knife_kill" , "20")
    health_add_knife_platinum = register_cvar("amx_platinum_health_knife_kill" , "25")
    health_add_knife_diamond = register_cvar("amx_diamond_health_knife_kill" , "35")
    armor_add_knife_gold = register_cvar("amx_gold_armor_knife_kill" , "20")
    armor_add_knife_platinum = register_cvar("amx_platinum_armor_knife_kill" , "25")
    armor_add_knife_diamond = register_cvar("amx_diamond_armor_knife_kill" , "35")
   
    g_iMaxPlayers = get_maxplayers( )

    register_clcmd("say", "handle_say")
    RegisterHam(Ham_Spawn, "player", "Ham_Spawn_Post", 1)
    register_event("DeathMsg", "hook_death", "a", "1>0")
    register_event( "CurWeapon" , "fw_EvCurWeapon" , "be" , "1=1" );
}
   

public hook_death()
{
   // Killer id
   nKiller = read_data(1)
   weapon = get_user_weapon(nKiller) // Va verifica daca este cutit sau nu dupa aceea Cutitul este CSW_KNIFE
   
   if(!(get_user_flags(nKiller) & GOLD_MEMBER) || !(get_user_flags(nKiller) & PLATINUM_MEMBER) || !(get_user_flags(nKiller) & DIAMOND_MEMBER)) {
       
    return
}

   if( !( 1 <= nKiller <= g_iMaxPlayers )
    || !is_user_alive( nKiller ) )
    {
        return;
    }
   
   if(weapon != CSW_KNIFE)
   {
       
   
    if ( (read_data(3) == 1) && (read_data(5) == 0) )
    {
        if(get_user_flags(nKiller) & DIAMOND_MEMBER)   
            nHp_add = get_pcvar_num (health_hs_add_diamond)
        else if(get_user_flags(nKiller) & PLATINUM_MEMBER)
            nHp_add = get_pcvar_num (health_hs_add_platinum)
        else if(get_user_flags(nKiller) & GOLD_MEMBER)
            nHp_add = get_pcvar_num (health_hs_add_gold)
       
        if(get_user_flags(nKiller) & DIAMOND_MEMBER)   
            nAp_add = get_pcvar_num (armor_hs_add_diamond)
        else if(get_user_flags(nKiller) & PLATINUM_MEMBER)
            nAp_add = get_pcvar_num (armor_hs_add_platinum)
        else if(get_user_flags(nKiller) & GOLD_MEMBER)
            nAp_add = get_pcvar_num (armor_hs_add_gold)
     
     
    }
   
    else
   
    {
        if(get_user_flags(nKiller) & DIAMOND_MEMBER)   
            nHp_add = get_pcvar_num (health_add_diamond)
        else if(get_user_flags(nKiller) & PLATINUM_MEMBER)
            nHp_add = get_pcvar_num (health_add_platinum)
        else if(get_user_flags(nKiller) & GOLD_MEMBER)
            nHp_add = get_pcvar_num (health_add_gold)
    //nHp_add = get_pcvar_num (health_add)   
        if(get_user_flags(nKiller) & DIAMOND_MEMBER)   
            nHp_max = get_pcvar_num (health_max_diamond)
        else if(get_user_flags(nKiller) & PLATINUM_MEMBER)
            nHp_max = get_pcvar_num (health_max_platinum)
        else if(get_user_flags(nKiller) & GOLD_MEMBER)
            nHp_max = get_pcvar_num (health_max_gold)
    //nHp_max = get_pcvar_num (health_max)
        if(get_user_flags(nKiller) & DIAMOND_MEMBER)   
            nAp_add = get_pcvar_num (armor_add_diamond)
        else if(get_user_flags(nKiller) & PLATINUM_MEMBER)
            nAp_add = get_pcvar_num (armor_add_platinum)
        else if(get_user_flags(nKiller) & GOLD_MEMBER)
            nAp_add = get_pcvar_num (armor_add_gold)
    //nAp_max = get_pcvar_num (armor_max)
        if(get_user_flags(nKiller) & DIAMOND_MEMBER)   
            nAp_max = get_pcvar_num (armor_max_diamond)
        else if(get_user_flags(nKiller) & PLATINUM_MEMBER)
            nAp_max = get_pcvar_num (armor_max_platinum)
        else if(get_user_flags(nKiller) & GOLD_MEMBER)
            nAp_max = get_pcvar_num (armor_max_gold)
    }
   }
   
   else {
        if(get_user_flags(nKiller) & DIAMOND_MEMBER)   
        nAp_add = get_pcvar_num (armor_add_knife_diamond)
        else if(get_user_flags(nKiller) & PLATINUM_MEMBER)
        nAp_add = get_pcvar_num (armor_add_knife_platinum)
        else if(get_user_flags(nKiller) & GOLD_MEMBER)
        nAp_add = get_pcvar_num (armor_add_knife_gold)
       
        if(get_user_flags(nKiller) & DIAMOND_MEMBER)   
        nHp_add = get_pcvar_num (health_add_knife_diamond)
        else if(get_user_flags(nKiller) & PLATINUM_MEMBER)
        nHp_add = get_pcvar_num (health_add_knife_platinum)
        else if(get_user_flags(nKiller) & GOLD_MEMBER)
        nHp_add = get_pcvar_num (health_add_knife_gold)
    }
   
   
   // Updating Killer HP

   nKiller_hp = get_user_health(nKiller)
   nKiller_hp += nHp_add
   // Updating Killer AP

   nKiller_ap = get_user_armor(nKiller)
   nKiller_ap += nAp_add
   // Maximum HP check
   if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
   set_user_health(nKiller, nKiller_hp)
   // Maximum AP check
   if (nKiller_ap > nAp_max) nKiller_ap = nAp_max
   set_user_armor(nKiller, nKiller_ap)
   
   set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
   show_hudmessage(nKiller, "Healed +%d hp", nHp_add)
   
   // Screen fading
   message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, nKiller)
   write_short(1<<10)
   write_short(1<<10)
   write_short(0x0000)
   write_byte(0)
   write_byte(0)
   write_byte(200)
   write_byte(75)
   message_end()
 
}

public ShowMotd(id)
{
 show_motd(id, "vip.txt")
}

public Ham_Spawn_Post(id)
{
    if(!is_user_alive(id))
        return;
   
    if(get_user_flags(id) & DIAMOND_MEMBER) {
        set_user_maxspeed(id,DIAMOND_MEMBER_SPEED_SPAWN)
        set_user_health(id,DIAMOND_MEMBER_HP_SPAWN)
        set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, get_pcvar_num(diamond_visibility))
    }
    else if(get_user_flags(id) & PLATINUM_MEMBER) {
        set_user_maxspeed(id,PLATINUM_MEMBER_SPEED_SPAWN)
        set_user_health(id,PLATINUM_MEMBER_HP_SPAWN)
    }
    else if(get_user_flags(id) & GOLD_MEMBER) {
        set_user_maxspeed(id,GOLD_MEMBER_SPEED_SPAWN)
        set_user_health(id,GOLD_MEMBER_HP_SPAWN)
    }
   
}

public fw_EvCurWeapon(id)
{
    new iCurWeapon = read_data(2)
       
    if( iCurWeapon != g_iPrevCurWeapon[id])
    {
   
    if(get_user_flags(id) & DIAMOND_MEMBER)   
    set_user_maxspeed(id ,DIAMOND_MEMBER_SPEED_SPAWN)
    else if(get_user_flags(id) & PLATINUM_MEMBER)
    set_user_maxspeed(id ,PLATINUM_MEMBER_SPEED_SPAWN)
    else if(get_user_flags(id) & GOLD_MEMBER)
    set_user_maxspeed(id ,GOLD_MEMBER_SPEED_SPAWN)
    g_iPrevCurWeapon[id] = iCurWeapon
    }


public handle_say(id) {
    new said[192]
    read_args(said,192)
    if( contain(said, "/beneficii") != -1 )
        set_task(0.1,"ShowMotd",id)   
    return PLUGIN_CONTINUE
}

0 0
  
Back to top
View user's profile Send private message
ZPLegendary

[Mentally Stable]



Status: Offline
(since 03-10-2019 20:59)
Joined: 13 Jan 2017
Posts: 142, Topics: 7
Location: Polovragi, GJ

Reputation: 15.4
Votes: 17

     
Post Posted: 25-04-2017, 12:16:47 | Translate post to: ... (Click for more languages)

Nu vad nimic in plugin care ar putea sa cauzeze asta

Incearca asta
Spoiler:


de fapt, cred ca am gasit acum o problema, vezi asa
Spoiler:


Be the one, not anyone.
Currently working on Zombie Legendary 8.1


1 0
  
Back to top
View user's profile Send private message
detalex11

[Mentally Stable]



Status: Offline
(since 09-05-2019 18:20)
Joined: 23 Oct 2016
Posts: 26, Topics: 5
Location: Romania

Reputation: 67.9
Votes: 1

Post Posted: 27-04-2017, 00:41:02 | Translate post to: ... (Click for more languages)

Am incercat pe al doilea iar la diamond ar fi maxhp 150 iar eu ajung si la 250 desi normal nu ar trebui bugu nu lam observat sa apara iar acum nu mai da APla frag si il numara cu minus daca am 100 si fac frag mil scade la 25 iar la urmatoru numai face nimic daor HP da
0 0
  
Back to top
View user's profile Send private message
ZPLegendary

[Mentally Stable]



Status: Offline
(since 03-10-2019 20:59)
Joined: 13 Jan 2017
Posts: 142, Topics: 7
Location: Polovragi, GJ

Reputation: 15.4
Votes: 17

     
Post Posted: 27-04-2017, 01:20:23 | Translate post to: ... (Click for more languages)

Ma uit iar maine peste el si o sa revin cu edit, acum am stins pc-ul

Be the one, not anyone.
Currently working on Zombie Legendary 8.1


0 0
  
Back to top
View user's profile Send private message
ZPLegendary

[Mentally Stable]



Status: Offline
(since 03-10-2019 20:59)
Joined: 13 Jan 2017
Posts: 142, Topics: 7
Location: Polovragi, GJ

Reputation: 15.4
Votes: 17

     
Post Posted: 27-04-2017, 10:10:35 | Translate post to: ... (Click for more languages)

vezi asa
Spoiler:


Be the one, not anyone.
Currently working on Zombie Legendary 8.1


0 0
  
Back to top
View user's profile Send private message
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support  


The time now is 30-07-2025, 21:58:49
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password