This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Help me


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Artifact
Veteran Member
Join Date: Jul 2010
Old 03-28-2012 , 05:51   Help me
Reply With Quote #1

What is wrong in this code?
PHP Code:
#include <amxmodx>

new VoteMenu
new Votes[2
new 
gVoting 

public plugin_init()
{
    
register_clcmd"amx_awpvote","Vote"
}

public 
Vote(id)
{
    if( 
gVoting )
    {
        
client_print(idprint_chat"There is already a vote going (Vote jos uvek traje)"
        return 
PLUGIN_HANDLED 
    
}
    
VoteMenu menu_create("\rAWP?:""menu_handler"
    
menu_additem(VoteMenu"Yes (Da)""0"0
    
menu_additem(VoteMenu"No (Ne)""1"0
    new 
players[32], pnumtempid 
    get_players
(playerspnum
    for( new 
i<pnum i++ )
    {
        
tempid players[i
        
menu_display(tempidVoteMenu0
        
gVoting++ 
    }
    
set_task(10.0"End"
    
    return 
PLUGIN_HANDLED 
}
public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT || !gVoting )
    {
        return 
PLUGIN_HANDLED 
    
}
    
    new 
data[6], szName[64
    new 
accesscallback 
    menu_item_getinfo
(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback
    new 
voteid str_to_num(data
    
Votes[voteid]++ 
    return 
PLUGIN_HANDLED 
}
public 
End()
{
    if( 
Votes[0] > Votes[1] )
        
client_print(0print_chat"AWP permitted (Dozvoljen AWP) (%d)"Votes[0] ) 
    else if( 
Votes[0] < Votes[1] )
    {
        
client_print(0print_chat"AWP illegal (Ne dozvoljen AWP) (%d)"Votes[1] ) 
        
set_task(0.1"DropAWP")
    }
    else
        
client_print(0print_chat"Do what you want (Radi sta hoces)"Votes[0] ) 
    
    
menu_destroy(VoteMenu
    
gVoting 
}

public 
DropAWP(id)
{
    new 
awp get_user_weapon(id,_,_)
    if(
awp == CSW_AWP)
    {
        
client_print(idprint_chat"AWP is not now allowed")
        
client_print(idprint_chat"AWP nije trenutno dozvoljen")
        
client_cmd(id"drop")
    }
    else 
        return 
PLUGIN_HANDLED
    
return PLUGIN_HANDLED

Plugin not doing drop command when user buy AWP... Why? Can someone fix that... (If you dont know what is wrong dont replay)
__________________
Artifact is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 03-28-2012 , 07:10   Re: Help me
Reply With Quote #2

use event_curweapon

Last edited by EpicMonkey; 03-28-2012 at 07:11.
EpicMonkey 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 11:59.


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