Raised This Month: $ Target: $400
 0% 

clcmd not working?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
entc
Junior Member
Join Date: May 2008
Old 07-29-2009 , 09:34   clcmd not working?
Reply With Quote #1

I have this code:
Code:
    register_clcmd("say /class", "ChangeClass");
    register_clcmd("say_team /class", "ChangeClass");
    register_clcmd("say /xp", "ShowHud");
    register_clcmd("say_team /xp", "ShowHud");
Code:
public ShowHud(id) {
    set_hudmessage(255, 0, 0, 0.75, 0.01, 0, 6.0, 15.0);
    show_hudmessage(id, "Level: %i^nXP: %i^nClass: %s", PlayerLevel[id], PlayerXP[id], CLASSES[PlayerClass[id]]);
}
Code:
public ChangeClass(id) {
    new menu = menu_create("Class Menu", "Class_Handle");
    menu_additem(menu, "uno", "1", 0);
    menu_additem(menu, "dos", "2", 0);
    menu_additem(menu, "tres", "3", 0);
    
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
    menu_display(id, menu, 0);
    
    return PLUGIN_CONTINUE;
}

public Class_Handle(id, menu, item) {
    if(item == MENU_EXIT)
        menu_destroy(menu);
        
    new szCommand[6], szName[64];
    new access, callback;
    
    menu_item_getinfo(menu, item, access, szCommand, 5, szName, 63, callback);
    
    new i = str_to_num(szCommand);
    if(PlayerClass[id] != i) {
        PlayerClass[id] = i;
        client_print(id,print_chat,"[%s] You are now a %s", PREFIX, CLASSES[i]);
    } else
        client_print(id,print_chat,"[%s] You are allready a %s", PREFIX, CLASSES[i]);
        
    menu_destroy(menu);
    return PLUGIN_CONTINUE;
}
BUT, the clcmds wont work. When i type either /class or /xp nothing happens. I have checked the code a million times without finding anything wrong. You guys have any idea?
entc 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 18:24.


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