Raised This Month: $ Target: $400
 0% 

how i put items only for vips?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
skdc
Junior Member
Join Date: Feb 2012
Old 05-14-2012 , 04:31   how i put items only for vips?
Reply With Quote #1

well i have a server with vips, and i wanna put items only for vips, can someone teache me how i do it?

thank you.
skdc is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-14-2012 , 07:04   Re: how i put items only for vips?
Reply With Quote #2

Check if the user has the vip flag.

PHP Code:
if(get_user_flags(id) & ADMIN_*) // see amxconst.inc for flag defines 
__________________

Last edited by <VeCo>; 05-14-2012 at 07:05.
<VeCo> is offline
skdc
Junior Member
Join Date: Feb 2012
Old 05-14-2012 , 07:14   Re: how i put items only for vips?
Reply With Quote #3

yhe i use this 1 :

#define ADMIN_RESERVATION (1<<1) /* flag "b" */

i alredy put , its only for vips, but the items i put for vips the others players can buy, why?

the normal players buy but they cant use it, only want to put the vips can buy.
skdc is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-14-2012 , 07:24   Re: how i put items only for vips?
Reply With Quote #4

Then you don't put the check where it should be. If you don't understand scripting - post in the suggestions/request section and show what plugins do you want to make only for vips.
__________________
<VeCo> is offline
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
Reply



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