Raised This Month: $ Target: $400
 0% 

[ HELP ] Don't allow select same case in round


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
JoaoVieira
Senior Member
Join Date: May 2013
Location: Portugal
Old 09-01-2016 , 23:32   [ HELP ] Don't allow select same case in round
Reply With Quote #1

I want to dont allow player to select same case in round like , If user select deagle , he won't be able to select it again in the same round. Thanks.
PS: This is a test menu.

Sorry for my english

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fun>

#define PLUGIN "Simple Menu"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new iPoints[33]

new 
pCvarPreco1

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /points""DisplayMenu")
    
    
register_event("DeathMsg""eDeath""a""1>0")
    
    
pCvarPreco1 register_cvar("preco1""5")
}

public 
DisplayMenu(id) {
    new 
menu menu_create("\w[\r AMXX \w]^n\yBuy""menu_handler")
    
    
menu_additem(menu"\ybuy 1""1")
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu)
}

public 
menu_handler(idmenuitem) {
    new 
price get_pcvar_num(pCvarPreco1)
    
    switch(
item) {
        case 
0: {
            if(
iPoints[id] >= price && is_user_alive(id)) {
                
give_item(id"weapon_deagle")
            } 
            else {
                
ColorChat(idGREEN"[AMXX]^1 You don't have enough points.")
            }
        }
    }
    
menu_destroy(menu)
}

public 
eDeath() {
    new 
killer    read_data(1)
    new 
victim    read_data(2)
    
    if(
killer != victim) {
        
iPoints[killer]++
    }


Last edited by JoaoVieira; 09-01-2016 at 23:37.
JoaoVieira 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 08:01.


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