Thread: Script problem
View Single Post
Author Message
Nike2000
New Member
Join Date: Jul 2010
Old 07-19-2010 , 06:13   Script problem
Reply With Quote #1

Hello guys i have a problem whit my script
i dont know whats the problem
this is the script:
PHP Code:
#include <amxmodx>
#include <fun>
#include <amxmisc>
#include <cstrike>
            
new plugin_on

enum Color
{
    
NORMAL 1// clients scr_concolor cvar color
    
GREEN// Green Color
    
TEAM_COLOR// Red, grey, blue
    
GREY// grey
    
RED// Red
    
BLUE// Blue
}

new 
TeamName[][] = 
{
    
"",
    
"TERRORIST",
    
"CT",
    
"SPECTATOR"
}


public 
plugin_init(){

    
register_plugin("ADMIN MODELS MENU""1.0""HQ # NiKe aka NiKe2000")
    
register_menucmd(register_menuid("ADMIN MODELS MENU"), 1023"setoption"
    
plugin_on register_cvar("amx_admodels""1")


    
register_clcmd("say /adminmodels","admin_models",ADMIN_KICK)
    
register_clcmd("say_team /adminmodels","admin_models",ADMIN_KICK)

  
}

public 
admin_models(id,level,cid
{
    if ( !
get_pcvar_num(plugin_on) ) 
    {    
        
ColorChat(idRED"Admin Models Menu is currently disabled");
        return 
PLUGIN_HANDLED;
    }
 
        if(!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED
        
    chooseoption
(id)
    
    return 
PLUGIN_HANDLED
       
}

public 
chooseoption(id)
{
    new 
menu[192
    new 
keys MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9     
    format
(menu191"\yADMIN MODELS MENU^n^n\r1.\w Admin Girl1^n\r2.\w Admin Girl2^n\r3.\w Admin Girl3^n\r4.\w Admin Girl4^n\r5.\w Admin Vip^n\r6.\w Armored Admin^n^n\r7.\w Predator^n\r8.\w SpiderMan^n\r9.\w Reset Admin Model^n^n\r0.\w Exit"
    
show_menu(idkeysmenu)      
    return 
PLUGIN_CONTINUE
}

public 
setoption(idkeymenu)
{
    if(
key == 0) {
         new 
name[17]
         
get_user_name(idname18)
         
cs_set_user_model(id"admin_girl1")
         
ColorChat(idTEAM_COLOR"^x04[ADMIN] ^x03%s^x01 has set Model ^x03Admin Girl1"name)
         return 
PLUGIN_HANDLED
    
}

    if(
key == 1) {
         new 
name[17]
         
get_user_name(idname18)
         
cs_set_user_model(id"admin_girl2")
         
ColorChat(idTEAM_COLOR"^x04[ADMIN] ^x03%s^x01 has set Model ^x03Admin Girl2"name)
         return 
PLUGIN_HANDLED

    
}

    if(
key == 2) {
         new 
name[17]
         
get_user_name(idname18)
         
cs_set_user_model(id"admin_girl3")
         
ColorChat(idTEAM_COLOR"^x04[ADMIN] ^x03%s^x01 has set Model ^x03Admin Girl3"name)
         return 
PLUGIN_HANDLED
    
}

    if(
key == 3) {
         new 
name[17]
         
get_user_name(idname18)
         
cs_set_user_model(id"admin_girl4")
         
ColorChat(idTEAM_COLOR"^x04[ADMIN] ^x03%s^x01 has set Model ^x03Admin Girl4"name)
         return 
PLUGIN_HANDLED

    
}

    if(
key == 4) {
         new 
name[17]
         
get_user_name(idname18)
         
cs_set_user_model(id"vip")
         
ColorChat(idTEAM_COLOR"^x04[ADMIN] ^x03%s^x01 has set Model ^x03Admin Vip"name)
         return 
PLUGIN_HANDLED
    
}

    if(
key == 5) {
         new 
name[17]
         
get_user_name(idname18)
         
cs_set_user_model(id"Armored_Admin")
         
ColorChat(idTEAM_COLOR"^x04[ADMIN] ^x03%s^x01 has set Model ^x03Armored Admin"name)
         return 
PLUGIN_HANDLED
    
}
    
    if(
key == 6) {
         new 
name[17]
         
get_user_name(idname18)
         
cs_set_user_model(id"admin_predator")
         
ColorChat(idTEAM_COLOR"^x04[ADMIN] ^x03%s^x01 has set Model ^x03Predator"name)
         return 
PLUGIN_HANDLED
    
}

    if(
key == 7) {
         new 
name[17]
         
get_user_name(idname18)
         
cs_set_user_model(id"admin_spiderman")
         
ColorChat(idTEAM_COLOR"^x04[ADMIN] ^x03%s^x01 has set Model ^x03SpiderMan"name)
         return 
PLUGIN_HANDLED
    
}

    if(
key == 8) {
         new 
name[17]
         
get_user_name(idname18)
         
cs_reset_user_model (id)
         
ColorChat(0RED"^x04[VIP] ^x03%s^x01  has  resetted his ^x04Admin Model"name)
         return 
PLUGIN_HANDLED
    
}
         
    else {
         return 
PLUGIN_HANDLED
    
}

    return 
PLUGIN_HANDLED
}

public 
plugin_precache()
{
    
precache_model("models/player/admin_models/admin_girl1.mdl")
    
precache_model("models/player/admin_models/admin_girl2.mdl")
    
precache_model("models/player/admin_models/admin_girl3.mdl")
    
precache_model("models/player/admin_models/admin_girl4.mdl")
    
precache_model("models/player/admin_models/vip.mdl")
    
precache_model("models/player/admin_models/Armored_Admin.mdl")
    
precache_model("models/player/admin_models/admin_predator.mdl")
    
precache_model("models/player/admin_models/admin_spiderman.mdl")
    return 
PLUGIN_CONTINUE 

}

ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
    new 
message[256];

    switch(
type)
    {
        case 
NORMAL// clients scr_concolor cvar color
        
{
            
message[0] = 0x01;
        }
        case 
GREEN// Green
        
{
            
message[0] = 0x04;
        }
        default: 
// White, Red, Blue
        
{
            
message[0] = 0x03;
        }
    }

    
vformat(message[1], 251msg4);

    
// Make sure message is not longer than 192 character. Will crash the server.
    
message[192] = '^0';

    new 
teamColorChangeindexMSG_Type;
    
    if(
id)
    {
        
MSG_Type MSG_ONE;
        
index id;
    } else {
        
index FindPlayer();
        
MSG_Type MSG_ALL;
    }
    
    
team get_user_team(index);
    
ColorChange ColorSelection(indexMSG_Typetype);

    
ShowColorMessage(indexMSG_Typemessage);
        
    if(
ColorChange)
    {
        
Team_Info(indexMSG_TypeTeamName[team]);
    }
}

ShowColorMessage(idtypemessage[])
{
    static 
bool:saytext_used;
    static 
get_user_msgid_saytext;
    if(!
saytext_used)
    {
        
get_user_msgid_saytext get_user_msgid("SayText");
        
saytext_used true;
    }
    
message_begin(typeget_user_msgid_saytext_id);
    
write_byte(id)        
    
write_string(message);
    
message_end();    
}

Team_Info(idtypeteam[])
{
    static 
bool:teaminfo_used;
    static 
get_user_msgid_teaminfo;
    if(!
teaminfo_used)
    {
        
get_user_msgid_teaminfo get_user_msgid("TeamInfo");
        
teaminfo_used true;
    }
    
message_begin(typeget_user_msgid_teaminfo_id);
    
write_byte(id);
    
write_string(team);
    
message_end();

    return 
1;
}

ColorSelection(indextypeColor:Type)
{
    switch(
Type)
    {
        case 
RED:
        {
            return 
Team_Info(indextypeTeamName[1]);
        }
        case 
BLUE:
        {
            return 
Team_Info(indextypeTeamName[2]);
        }
        case 
GREY:
        {
            return 
Team_Info(indextypeTeamName[0]);
        }
    }

    return 
0;
}

FindPlayer()
{
    new 
= -1;

    while(
<= get_maxplayers())
    {
        if(
is_user_connected(++i))
            return 
i;
    }

    return -
1;

Its an menu for admins whit models, they can change models, but i tried it and only one model worked i have the models on the server

Please i need help, btw i compiled it too
Nike2000 is offline