Raised This Month: $12 Target: $400
 3% 

weapon don't change


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yamin
BANNED
Join Date: Jan 2012
Location: Sharjah
Old 06-12-2012 , 14:52   weapon don't change
Reply With Quote #1

why this engclient_cmd( id, "weapon_usp" ); don't work?

Last edited by yamin; 06-13-2012 at 06:54.
yamin is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-12-2012 , 15:02   Re: weapon don't change
Reply With Quote #2

You need to stop making a hundred topics for this 1 plugin.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-12-2012 , 16:58   Re: weapon don't change
Reply With Quote #3

PHP Code:
 register_clcmd"amx_knife","giveweapon");
 
register_concmd("amx_knife""ConCmd_BlockBuy"ADMIN_MAP);
 
register_clcmd"amx_knife""ClientCommand_Knife",ADMIN|SILVER|GOLDEN"- start knife round" ); 
I think it could be a problem to register same command with 3 different handlers, depending on what you return in them.
Make only 1 callback.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
yamin
BANNED
Join Date: Jan 2012
Location: Sharjah
Old 06-13-2012 , 07:06   Re: weapon don't change
Reply With Quote #4

how will i do it on 1 callback?
yamin is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-13-2012 , 07:07   Re: weapon don't change
Reply With Quote #5

Remove the second and third command and change the content of the "giveweapon" handler.

You can check the flags there with get_user_flags.
Backstabnoob is offline
yamin
BANNED
Join Date: Jan 2012
Location: Sharjah
Old 06-13-2012 , 07:44   Re: weapon don't change
Reply With Quote #6

can you add here?
PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < hamsandwich >
#include < fun >
#include < cstrike >
#include <fakemeta_util>
#define ADMIN   ADMIN_RCON 
#define SILVER  ADMIN_LEVEL_G 
#define GOLDEN  ADMIN_LEVEL_H 
#define SetUserAdmin(%0)      ( gBitAdmin |= ( 1 << ( %0 & 31 ) ) )
#define ClearUserAdmin(%0)    ( gBitAdmin &= ( ~( 1 << ( %0 & 31 ) ) ) )
#define IsAdmin(%0)           ( gBitAdmin & ( 1 << ( %0 & 31 ) ) )
enum ChatColor 

CHATCOLOR_NORMAL 1
CHATCOLOR_GREEN
CHATCOLOR_TEAM_COLOR
CHATCOLOR_GREY,      
CHATCOLOR_RED,    
CHATCOLOR_BLUE,      
}
new 
bool:g_bBuyBlocked
new gBlocked;
new 
gBitAdmin;
new 
uflags[33];
public 
client_putinserver(id){ 
if(
get_user_flags(id)&ADMIN
 
uflags[id] = ADMIN 
 
else if(get_user_flags(id)&GOLDEN
  
uflags[id] = GOLDEN 
 
else if(get_user_flags(id)&SILVER
  
uflags[id] = SILVER 
 
else 
  
uflags[id] = 

public 
plugin_init( )
{
 
register_event"CurWeapon""eCurWeapon""be""1=1""2!29" );
 
register_event"HLTV""eNewRound""a""1=0""2=0" );
 
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0");
 
 
register_concmd("amx_knife""ConCmd_BlockBuy"ADMIN_MAP);
 
register_clcmd"amx_knife""ClientCommand_Knife",ADMIN|SILVER|GOLDEN"- start knife round" );
}
public 
ClientCommand_Knifeidlevelcid )
{
 if( !
cmd_accessidlevelcid) )
  return 
PLUGIN_HANDLED;
 
 if( 
gBlocked )
  return 
PLUGIN_HANDLED;
   
   
 
 
gBlocked true;    
 new 
szName[32],level[10];
 
get_user_nameidszName31 );
 
get_level_by_flag(id,level);
 
 
 
colorChat(0,CHATCOLOR_NORMAL,"$g[$tSoloGunner$g]$n SoloGunner activated by $g%s$n $g[$t%s$g]",szName,level
 return 
PLUGIN_HANDLED
}
public 
eCurWeaponid )
{
 if( 
gBlocked )
 {
  if(!
IsAdmin(id))
  {
   
engclient_cmdid"weapon_usp" );
  }
  
  else
  {
   if( 
read_data) != CSW_USP )
   {
    
engclient_cmdid"weapon_knife" );
   }
  }
 }
}
public 
ConCmd_BlockBuy(idlvlcid

    if( 
cmd_access(idlvlcid0) ) 
{
    
engclient_cmdid"weapon_usp" );
    
fm_give_itemid,"weapon_usp" );
    
cs_set_user_bpammo(id,CSW_USP,12);
   }    

        
g_bBuyBlocked true 
    

    return 
PLUGIN_HANDLED 


public 
Event_HLTV_New_Round() 

    if( 
g_bBuyBlocked 
    { 
        
g_bBuyBlocked false 
    



public 
client_buy(iditem

    if( 
g_bBuyBlocked 
    { 
        
client_print(idprint_chat"*** Buy is restricted for this round"
        return 
PLUGIN_HANDLED 
    

    return 
PLUGIN_CONTINUE 
}
public 
eNewRound( )
{
 
gBlocked false;
}
get_level_by_flag(id,level[]){ 
 switch(
uflags[id]){ 
  case 
ADMINcopy(level,9,"ADMIN"
   case 
SILVERcopy(level,9,"SILVER"
   case 
GOLDENcopy(level,9,"GOLDEN"
  } 

colorChat(idChatColor:color, const msg[], {Float,Sql,Result,_}:...) 

new 
teamindexMSG_Type 
new bool:teamChanged false 
static message[192
switch(
color

 case 
CHATCOLOR_NORMAL// Normal 
 

  
message[0] = 0x01
 } 
 case 
CHATCOLOR_GREEN// Green 
 

  
message[0] = 0x04
 } 
 default: 
// Grey, Red, Blue 

 
message[0] = 0x03


vformat(message[1], 190msg4); 
replace_all(message190"$g""^x04"
replace_all(message190"$n""^x01"
replace_all(message190"$t""^x03"
if(
id == 0

index findAnyPlayer() 
MSG_Type MSG_ALL

else 

index id
MSG_Type MSG_ONE

if(
index != 0

team get_user_team(index);     
if(
color == CHATCOLOR_RED && team != 1

 
messageTeamInfo(indexMSG_Type"TERRORIST"
 
teamChanged true 

else 
 if(
color == CHATCOLOR_BLUE && team != 2
 { 
  
messageTeamInfo(indexMSG_Type"CT"
  
teamChanged true 
 

 else 
  if(
color == CHATCOLOR_GREY && team != 0
  { 
   
messageTeamInfo(indexMSG_Type,""
   
teamChanged true 
  
}
messageSayText(indexMSG_Typemessage);
if(
teamChanged
  { 
   
messageTeamInfo(indexMSG_Type"SPECTATOR")  
  } 
 } 

messageSayText(idtypemessage[]) 

message_begin(typeget_user_msgid("SayText"), _id
write_byte(id)     
write_string(message
message_end() 

messageTeamInfo(idtypeteam[]) 

message_begin(typeget_user_msgid("TeamInfo"), _id
write_byte(id
write_string(team
message_end() 

findAnyPlayer() 

static 
players[32], inumpid 
get_players
(playersinum"ch"
for (new 
0inuma++) 

pid players[a
if(
is_user_connected(pid)) 
return 
pid 

return 



Last edited by yamin; 06-13-2012 at 07:45.
yamin is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 06-13-2012 , 11:11   Re: weapon don't change
Reply With Quote #7

Post in the request section.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Reply



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 20:21.


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