Raised This Month: $ Target: $400
 0% 

Models won't turn off?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 12-31-2005 , 15:32   Models won't turn off?
Reply With Quote #1

Okay, trying to make a plugin for the ladies in servers. What it is supposed to do, is if they have the defined admin flag, they can access a menu with the cmd "femalemenu" and they can choose "on" or "off"

Problem is it nevers turns the model off, and everyone can access it. The access part I'm guessing I just forgot to add cmd_access, but that I can fix.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define ADMIN_ACCESS ADMIN_LEVEL_H new bool:hasfem[33]=false public plugin_init() {     register_plugin("Female Skins", "1.0", "Kensai")     register_concmd("femalemenu","Models",ADMIN_ACCESS,"Opens up the Female Skin Menu")     register_menucmd(register_menuid("menu_Models"),1023,"DoModels");     register_event("ResetHUD", "resetModel", "b")     return PLUGIN_CONTINUE } public plugin_precache() {     precache_model("models/player/f_ct/f_ct.mdl")     precache_model("models/player/f_t/f_t.mdl") } public client_putinserver(id) {     hasfem[id] = false } public resetModel(id,level,cid) {         if (get_user_flags(id) & ADMIN_ACCESS)     {                 new CsTeams:userTeam = cs_get_user_team(id)                 if (userTeam == CS_TEAM_T) {             cs_set_user_model(id,"f_t")             hasfem[id] = true                 }                 else if(userTeam == CS_TEAM_CT) {             cs_set_user_model(id,"f_ct")             hasfem[id] = true                 }                 else {             cs_reset_user_model(id)             hasfem[id] = false                 }         }         return PLUGIN_CONTINUE } public Models(id) {       if(!get_user_flags(id) & ADMIN_ACCESS)     return PLUGIN_HANDLED         new menu[192]       format(menu, 191, "Female Skins: On/Off^n^n1. On^n2. Off^n^n0. Exit")         new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_0     show_menu(id, keys, menu, 15, "menu_Models")             return PLUGIN_HANDLED }   public DoModels(id,level,cid,key) {     if(key == 0)     {         resetModel(id,level,cid)         hasfem[id] = true         client_print(id,print_chat,"[FEM] Model turned on successfully.")     }             if(key == 1)     {         cs_reset_user_model(id)         hasfem[id] = false         client_print(id,print_chat,"[FEM] Model turned off successfully.")     }     if(key == 0)     {         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED }

Thanks.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
 



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 16:05.


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