AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   amxx timer start and end message (https://forums.alliedmods.net/showthread.php?t=187867)

RuRuRu612754 06-19-2012 04:50

amxx timer start and end message
 
Hello

This plugins is does no work.
To run this plugin, what should I do?

PHP Code:

#include <amxmodx>
#include <colorchat>
#include <hamsandwich>
#include <fakemeta>

new Trie:g_tStarts
new Trie:g_tStops

new amxx_timer_prefix

public plugin_init()
{
    
amxx_timer_prefix register_cvar("amxx_timer_prefix""")

    
RegisterHam(Ham_Use"func_button""function_button"0)

    
g_tStarts TrieCreate()
    
g_tStops  TrieCreate()
}

public 
function_button(entid)
{
    new 
szTarget[32]
    
pev(entpev_targetszTarget31)

    if(
TrieKeyExists(g_tStartsszTarget))
    {
        
start_timer(id)
    }
    if(
TrieKeyExists(g_tStopsszTarget))
    {
        
end_timer(id)
    }
}

public 
start_timer(id)
{
    new 
prefix[128]
    
get_pcvar_string(amxx_timer_prefixprefix127)
    
ColorChat(idGREEN"[%s] Timer has start"prefix)
}

public 
end_timer(id)
{
    new 
prefix[128]
    
get_pcvar_string(amxx_timer_prefixprefix127)
    
ColorChat(idGREEN"[%s] Timer has end"prefix)



YamiKaitou 06-19-2012 05:19

Re: amxx timer start and end message
 
Define "does no work"

Where do you create the key in the Trie?


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

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