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
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-04-2016 , 16:21   Re: [ HELP ] Don't allow select same case in round
Reply With Quote #18

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <colorchat>
#include <hamsandwich>
#include <fun>

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

new iPoints[33]

new 
pCvarPreco1
new pCvarPreco2
new pCvarPreco3
new pCvarPreco4
new pCvarPreco5

new bool:hasDeagle[33]
new 
bool:hasM3[33]
new 
bool:hasM4[33]
new 
bool:hasAK47[33]
new 
bool:hasRespawn[33]

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

public 
RoundStart() {
    new 
players[32], inum
    get_players
(playersinum)
    
    for(new 
iinumi++) {
        if(
hasDeagle[players[i]] == true) {
            
hasDeagle[players[i]] = false
        
}
        
        if(
hasRespawn[players[i]] == true) {
            
hasRespawn[players[i]] = false
        
}
        
        if(
hasM4[players[i]] == true) {
            
hasM4[players[i]] = false
        
}
        
        if(
hasAK47[players[i]] == true) {
            
hasAK47[players[i]] = false
        
}
    }
}
public 
DisplayMenu(id
{
    
iPoints[id]+=1000000
    
new menu menu_create("\w[\r AMXX \w]^n\ySurf Shop""menu_handler")
    
    
menu_additem(menu"\yDeagle \r[ 20 \dPontos\r ]""1")
    
menu_additem(menu"\yM3 \r[ 60 \dPontos\r ]""2")
    
menu_additem(menu"\yM4 + colete \r[ 120 \dPontos\r ]""3")
    
menu_additem(menu"\yAK47 + colete \r[ 120 \dPontos\r ]""4")
    
menu_additem(menu"\yRespawn \r[ 240 \dPontos\r ]""5")
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu)
}

public 
menu_handler(idmenuitem
{
    new 
price get_pcvar_num(pCvarPreco1)
    new 
price1 get_pcvar_num(pCvarPreco2)
    new 
price2 get_pcvar_num(pCvarPreco3)
    new 
price3 get_pcvar_num(pCvarPreco4)
    new 
price4 get_pcvar_num(pCvarPreco5)
    
    switch(
item) {
        case 
0: {
            if(
hasDeagle[id] == false
            {
                if(
iPoints[id] >= price && is_user_alive(id)) 
                {
                    
iPoints[id] -= price
                    give_item
(id"weapon_deagle")
                    
cs_set_user_bpammo(idCSW_DEAGLE35)
                    
hasDeagle[id] = true
                

                else 
                {
                    
ColorChat(idGREEN"[ AMXX ]^1 Nao tens pontos suficientes.")
                }
            }
            else 
            {
                
ColorChat(idGREEN"[ AMXX ]^1 So podes comprar este item uma vez por ronda.")
            }
        }
        case 
1
        {
            if(
hasM3[id] == false
            {
                if(
iPoints[id] >= price1 && is_user_alive(id)) 
                {
                    
iPoints[id] -= price1              
                    give_item
(id"weapon_m3"
                    
cs_set_user_bpammo(idCSW_M335)
                    
hasM3[id] = true
                

                else 
                {
                    
ColorChat(idGREEN"[ AMXX ]^1 Nao tens pontos suficientes.")
                }
            }
            else 
            {
                
ColorChat(idGREEN"[ AMXX ]^1 So podes comprar este item uma vez por ronda.")
            }
        }
        case 
2
        {
            if(
hasM4[id] == false) {
                if(
iPoints[id] >= price2 && is_user_alive(id)) 
                {
                    
iPoints[id] -= price2
                    give_item
(id"weapon_m4a1"
                    
cs_set_user_bpammo(idCSW_M4A190)
                    
hasM4[id] = true          
                

                else 
                {
                    
ColorChat(idGREEN"[ AMXX ]^1 Nao tens pontos suficientes.")
                }
            }
            else 
            {
                
ColorChat(idGREEN"[ AMXX ]^1 So podes comprar este item uma vez por ronda.")
            }
        }
        case 
3
        {
            if(
hasAK47[id] == false) {
                if(
iPoints[id] >= price3 && is_user_alive(id)) 
                {
                    
iPoints[id] -= price3
                    give_item
(id"weapon_ak47"
                    
cs_set_user_bpammo(idCSW_AK4790)
                    
hasAK47[id] = true
                

                else 
                {
                    
ColorChat(idGREEN"[ AMXX ]^1 Nao tens pontos suficientes.")
                }
            }
            else 
            {
                
ColorChat(idGREEN"[ AMXX ]^1 So podes comprar este item uma vez por ronda.")
            }
        }
        case 
4
        {
            if(
hasRespawn[id] == false) {
                if(
iPoints[id] >= price4 && is_user_alive(id)) 
                {
                    
iPoints[id] -= price4
                    ExecuteHamB
(Ham_CS_RoundRespawnid)
                    
hasRespawn[id] = true
                
}   
                else 
                {
                    
ColorChat(idGREEN"[ AMXX ]^1 Nao tens pontos suficientes.")
                }
            }
            else 
            {
                
ColorChat(idGREEN"[ AMXX ]^1 So podes comprar este item uma vez por ronda.")
            }
        }
    }
    
menu_destroy(menu)
}

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

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
 



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