Raised This Month: $ Target: $400
 0% 

Toggle Camouflage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tulgaoguz
New Member
Join Date: Nov 2010
Old 11-14-2010 , 10:37   Toggle Camouflage
Reply With Quote #1

Hey guys! I wrote it but it isn't working.
Where is the wrong?
Could you help me

PHP Code:
new team;
team get_user_team(id);
if (
team == 1)  //TERRORIST
{
    
cs_set_user_model(id"urban");
}
else
{
    
cs_set_user_model(id"leet");

tulgaoguz is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 11-14-2010 , 10:50   Re: Toggle Camouflage
Reply With Quote #2

Show full code...and also use else if team == 2
bibu is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 11-15-2010 , 20:36   Re: Toggle Camouflage
Reply With Quote #3

Quote:
Originally Posted by bibu View Post
Show full code...and also use else if team == 2
It doesn't need to be else if( team == 2 ), he could just leave it how it was in-case they go spectator. It might automatically make them 'urban' when they join spectator though. Not sure, but either way it doesn't matter.
__________________
Hi.
Kreation is offline
tulgaoguz
New Member
Join Date: Nov 2010
Old 11-14-2010 , 11:35   Re: Toggle Camouflage
Reply With Quote #4

here the full codes. Where is the wrong ? :/

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
 
public plugin_init()
{
     
register_plugin("CAMenu""0.10""Oguz&Tulga");
     
register_clcmd("say !camenu""CokAmacliMenu");
}
 
public 
CokAmacliMenu(id)
{
     new 
menu menu_create("\yCokAmacliMenu:""camenu_handler");
 
     
menu_additem(menu"\wCamouflage On&Off""1"ADMIN_LEVEL_A);
 
     
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
     
menu_display(idmenu0);
}
 
public 
camenu_handler(idmenuitem)
{
     if( 
item == MENU_EXIT )
     {
          
menu_destroy(menu);
 
          return 
PLUGIN_HANDLED;
     }
 
     new 
data[6], iName[64];
     new 
accesscallback;
 
     
menu_item_getinfo(menuitemaccessdata5iName63callback);
 
     new 
key str_to_num(data);
 
     switch(
key)
     {
          case 
1:
          {
               new 
team;
               
team get_user_team(id);
               if (
team == 1)  //TERRORIST
               
{
                    
cs_set_user_model(id"urban");
                    
set_hudmessage(25500, -1.0, -1.0);
                    
show_hudmessage(id"Suan CT Gorunumundesiniz");
               }
               else if (
team == 2)
               {
                    
cs_set_user_model(id"leet");
                    
set_hudmessage(25500, -1.0, -1.0);
                    
show_hudmessage(id"Suan T Gorunumundesiniz");
               }
 
               
CokAmacliMenu(id);
          }
     }
 
     return 
PLUGIN_HANDLED;

tulgaoguz is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 11-14-2010 , 13:55   Re: Toggle Camouflage
Reply With Quote #5

PHP Code:
#pragma semicolon 1

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

// Define the Plugin Version
new const VERSION[] = "1.0";

new 
boolg_bCamoflauge[33];

public 
plugin_init()
{
    
register_plugin("Camoflauge"VERSION"Shuttle_Wave");

    
register_clcmd("say !camenu""cmdCamoMenu"ADMIN_LEVEL_H);
    
register_clcmd("say /camenu""cmdCamoMenu"ADMIN_LEVEL_H);
    
    
register_menucmd(register_menuid("Camoflauge Menu"),    1023,    "CamoflaugeMenu_Handler");
}

public 
client_connect(id)
    
g_bCamoflauge[id] = false;

public 
cmdCamoMenu(id)
{
    static 
iLenszMenu[512], iKeys;
    
    
iKeys = ( MENU_KEY_0 MENU_KEY_1 );
    
    
iLen formatex(szMenusizeof(szMenu) - 1"\yCamoflauge Menu:^n\rby Shuttle_Wave^n^n");
    
    
iLen += formatex(szMenu[iLen], sizeof(szMenu) - iLen"\r1. \wCamoflauge [ \r%s\w ]^n"g_bCamoflauge[id] ? "ON" "OFF");
    
    
iLen += formatex(szMenu[iLen], sizeof(szMenu) - iLen"^n\r0. \wExit");
    
    
show_menu(idiKeysszMenu, -1"Camoflauge Menu");
    
    return 
PLUGIN_HANDLED;
}

public 
CamoflaugeMenu_Handler(idkey)
{
    switch(
key)
    {
        case 
0:
        {    
            if(
g_bCamoflauge[id])
            {
                
set_hudmessage(002550.080.8106.01.0);
                
show_hudmessage(id"Camoflauge Reseted");
                
                
cs_reset_user_model(id);
                
g_bCamoflauge[id] = false;
                
                
cmdCamoMenu(id);
                return 
PLUGIN_HANDLED;
            }
            
            if(!
g_bCamoflauge[id] && cs_get_user_team(id) == CS_TEAM_T)
            {
                
set_hudmessage(025500.030.8206.01.0);
                
show_hudmessage(id"You are now Camoflaged as CT");
                
                
cs_set_user_model(id"urban");
                
g_bCamoflauge[id] = true;
            }
            
            else if(!
g_bCamoflauge[id] && cs_get_user_team(id) == CS_TEAM_CT)
            {
                
set_hudmessage(4225500.040.8706.01.0);
                
show_hudmessage(id"You are now Camoflaged as Terrorist");
                
                
cs_set_user_model(id"leet");
                
g_bCamoflauge[id] = true;
            }
        }
        
        case 
9: return PLUGIN_HANDLED;
        
    }
    
    
cmdCamoMenu(id);
    
    return 
PLUGIN_HANDLED;

shuttle_wave is offline
Reply


Thread Tools
Display Modes

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:25.


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