AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Models won't turn off? (https://forums.alliedmods.net/showthread.php?t=22637)

Kensai 12-31-2005 15:32

Models won't turn off?
 
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.

NoobSack ^_- 12-31-2005 16:31

this would be a nice feature.

i have alot of girls in my server... 5-6 i can think of.

they have been asking about this

Styles 12-31-2005 16:37

Dude just have it so that when that when they turn off the models it sets there models to the default models of cs by saying
cs_set_user_model(id, "Default Model Name")

u get it?

Kensai 12-31-2005 17:14

Because I want their models reset, not set. I don't wanna have to code more of checking teams and reseting models, if I can just say one line. I just want to know why it isn't working.

Styles 12-31-2005 17:46

Ok i did find a command

cs_reset_user_model ( index ) like you have

also you could
new currentmodel[33]
cs_get_user_model (id, currentmodel)
cs_set_user_model (id, currentmodel)

:) :)?


All times are GMT -4. The time now is 16:04.

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