Raised This Month: $ Target: $400
 0% 

Get_pcvar_float help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 05-26-2010 , 10:04   Get_pcvar_float help
Reply With Quote #1

I have this code:

PHP Code:
/*

    This plugin sets each 30 seconds  a rondom hitzone
    ##CVARS##
    amx_random_hitzones 1//0   (defaut 1)
    amx_random_hitzones_time 30.0


*/
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>


new toggle
new hold_time

public plugin_init() 
{
    
register_plugin("Random HitZones""1.1""S34Qu4K3")
    
    
toggle register_cvar("amx_random_hitzones""1")
    
hold_time   register_cvar("amx_random_hitzones_time""10.0")
    
    
RegisterHam(Ham_Spawn"player""Main"1);
    
    
register_dictionary("randomhitzones.txt")
}
public 
Main(id)
{
    if(
get_pcvar_num(toggle))
    {
    new 
rand random_num(0,7)
    switch(
rand)
    {
        case 
0:
        {
            
set_user_hitzones(,0255)
            
client_print(idprint_chat"%L"LANG_PLAYER"GENERIC")
        }
        case 
1:
        {
            
set_user_hitzones(,02)
            
client_print(idprint_chat"%L"LANG_PLAYER"HEAD_ONLY")
        }
        case 
2:
        {
            
set_user_hitzones(,04)
            
client_print(idprint_chat"%L"LANG_PLAYER"CHEST_ONLY")
        }
        case 
3:
        {
            
set_user_hitzones(,08)
            
client_print(idprint_chat"%L"LANG_PLAYER"STOMACH_ONLY")
        }
        case 
4:
        {
            
set_user_hitzones(,016)
            
client_print(idprint_chat"%L"LANG_PLAYER"LEFTARM_ONLY")
        }
        case 
5:
        {
            
set_user_hitzones(,032)
            
client_print(idprint_chat,  "%L"LANG_PLAYER,"RIGHTARM_ONLY")
        }
        case 
6:
        {
            
set_user_hitzones(,064)
            
client_print(idprint_chat,  "%L"LANG_PLAYER"LEFTLEG_ONLY")
        }
        case 
7:
        {
            
set_user_hitzones(,0128)
            
client_print(idprint_chat,  "%L"LANG_PLAYER,"RIGHTLEG_ONLY")
        }
    }
    
set_task(get_cvar_float("hold_time"),"Main")

    }
    else
    {
        
client_print(idprint_chat"%L"LANG_PLAYER"OFF")
    }

BUt I think that this part is bad:

PHP Code:
set_task(get_cvar_float("hold_time"),"Main"
Someone can help me?
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
 


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 05:20.


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