Raised This Month: $ Target: $400
 0% 

how i put items only for vips?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
skdc
Junior Member
Join Date: Feb 2012
Old 05-14-2012 , 07:28   Re: how i put items only for vips?
Reply With Quote #5

i have it like this.

PHP Code:
#include <amxmodx>
#include <umitem>

#define EspRate    2.5
#define ADMIN_LEVEL_RESERVATION
new PLUGIN_NAME[]     = "UM Item: ESP"
new PLUGIN_AUTHOR[]     = "Cheap_Suit"
new PLUGIN_VERSION[]     = "1.0"

new white
new bool:g_ESP[33]
public 
plugin_init() 
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_item("ESP-VIP""Expanding circles around enemies"3200)
    
register_event("ResetHUD""Event_ResetHUD""be")
    
register_event("DeathMsg""Event_DeathMsg""a")
}

public 
plugin_precache() {
    
white precache_model("sprites/white.spr")
}

public 
client_connect(id) {
    
g_ESP[id] = false
}

public 
Event_DeathMsg() 
{
    if(
task_exists(read_data(2))) {
        
remove_task(read_data(2))
    }
}

public 
Event_ResetHUD(id)
{
    if(!
is_user_alive(id) || !g_ESP[id]) {
        return 
PLUGIN_CONTINUE
    
}
    if(!
task_exists(id)) {
        
set_task(EspRate"esp_loop"id__"b")
    }
    return 
PLUGIN_CONTINUE
}

public 
Enable_Item(id
{        
         if (
is_user_alive(id) && (get_user_flags(id) & ADMIN_RESERVATION))
    
g_ESP[id] = true
    set_task
(EspRate"esp_loop"id__"b")
}

public 
Disable_Item(id
{
    
g_ESP[id] = false
    
if(task_exists(id)) {
        
remove_task(id)
    }
}

public 
esp_loop(id)
{    
    if(!
is_user_connected(id) || !is_user_alive(id) || !g_ESP[id]) 
    {
        if(
task_exists(id)) {
            
remove_task(id)
        }
        return 
PLUGIN_CONTINUE
    
}
    
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum"a")
    
    for(new 
0iNum; ++i)
    {
        new 
eId iPlayers[i]
        new 
aTeam get_user_team(id)
        new 
bTeam get_user_team(eId)
        if(
aTeam == bTeam || id == eId) {
            continue
        }

        new 
iOrigin[3]
        
get_user_origin(eIdiOrigin0)
            
        
message_begin(MSG_ONESVC_TEMPENTITYiOriginid)
        
write_byte(21)
        
write_coord(iOrigin[0])
        
write_coord(iOrigin[1])
        
write_coord(iOrigin[2] - 35)
        
write_coord(iOrigin[0])
        
write_coord(iOrigin[1])
        
write_coord(iOrigin[2] + 800)
        
write_short(white)
        
write_byte(0)
        
write_byte(1
        
write_byte(6
        
write_byte(8)
        
write_byte(1
        
write_byte(100)
        
write_byte(100)
        
write_byte(255)
        
write_byte(192)
        
write_byte(0)
        
message_end()
    }
    return 
PLUGIN_CONTINUE

skdc is offline
 



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


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