Raised This Month: $183 Target: $400
 45% 

kill x 2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Niklstr
New Member
Join Date: Jan 2021
Old 01-14-2021 , 02:52   kill x 2
Reply With Quote #1

Please help, installed on biohazard VERSION "2.00 Beta 3. AMX MOD X 1.8.2 does not add kill.
HTML Code:
#include <amxmodx>
#include <fun>

#define PLUGIN_VERSION "1.1"
#define TASK_MESSAGE 455223

new g_iObject,
    g_pStart,
    g_pEnd,
    g_iStart,
    g_iEnd,
    g_szName[33][32],
    bool:g_blActive

public plugin_init()
{
    register_plugin("Happy Frag Hour", PLUGIN_VERSION, "iPlay.bg (OciXCrom)")
    register_logevent("OnRoundStart", 2, "0=World triggered", "1=Round_Start")
    register_event("DeathMsg", "OnPlayerKilled", "a")
    g_pStart = register_cvar("happyhour_start", "20")
    g_pEnd = register_cvar("happyhour_end", "22")
    g_iObject = CreateHudSyncObj()
    OnRoundStart()
}

public client_putinserver(id)
{
    get_user_name(id, g_szName[id], charsmax(g_szName[]))
    set_task(1.0, "displayMessage", id + TASK_MESSAGE, .flags = "b")
}
    
public displayMessage(id)
{
    id -= TASK_MESSAGE
    set_hudmessage(random(256), random(256), random(256), 0.02, 0.2, 0, 0.1, 1.0, 0.1, 0.1, -1)
    ShowSyncHudMsg(id, g_iObject, "Good luck and have fun! %s^nNow Happy frag hour (%s)^nHappy Hour (Start in %i:00 | End in %i:00)", g_szName[id], g_blActive ? "On" : "Off", g_iStart, g_iEnd)
}

public client_infochanged(id)
{
    new szNewName[32], szOldName[32]
    get_user_info(id, "name", szNewName, charsmax(szNewName))
    get_user_name(id, szOldName, charsmax(szOldName))
    
    if(!equal(szNewName, szOldName))
        copy(g_szName[id], charsmax(g_szName[]), szNewName)
}

public OnRoundStart()
{
    GetCvars()
    
    new szHour[3]
    get_time("%H", szHour, charsmax(szHour))    
    
    new iHour = str_to_num(szHour)
    g_blActive = (iHour >= g_iStart && iHour <= g_iEnd) ? true : false
}

public OnPlayerKilled()
{
    if(!g_blActive)
        return
        
    new iAttacker = read_data(1),
        iVictim = read_data(2)
        
    if(!is_user_connected(iAttacker) || !is_user_connected(iVictim) || iAttacker == iVictim)
        return
        
    set_user_frags(iAttacker, get_user_frags(iAttacker) + 1)
}

GetCvars()
{
    g_iStart = get_pcvar_num(g_pStart)
    g_iEnd = get_pcvar_num(g_pEnd)
}
Niklstr is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-14-2021 , 08:24   Re: kill x 2
Reply With Quote #2

What do you expect this plugin to do? Kills added via AMXX plugins are not registered in /rank, so the plugin is pointless.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:04.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode