AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Only teror (https://forums.alliedmods.net/showthread.php?t=171384)

oei 11-05-2011 10:50

Only teror
 
i need only teror can do this
this is code from my hns shop

PHP Code:

public menu1(idmenuitem)
{
 if (
item == MENU_EXIT){
  
menu_destroy(menu)
  return 
PLUGIN_HANDLED
 
}
 
 new 
Data[6];
 new 
Access;
 new 
Callback;
 new 
Name[64];
 
menu_item_getinfo(menuitemAccessData5Name63Callback)
 
 new 
Key str_to_num(Data);
 
 switch (
Key){
  case 
1:{
   if (!
is_user_alive(id))
   {
    return 
PLUGIN_HANDLED
   
}
   new 
cost get_pcvar_num(cost_deagle)
   
   if (
money[id] < cost){
    
ColorChat(id,"^1You don't have money to Deagle")
   }
   else{
    
ColorChat(id,"your buy Deagle"Name)
    
cs_set_weapon_ammo(give_item(id"weapon_deagle"), 1);
      }
  }
 }
 
menu_destroy(menu)
 return 
PLUGIN_HANDLED
}
  } 


Bugsy 11-05-2011 10:54

Re: Only teror
 
PHP Code:

if ( cs_get_user_teamid ) != CS_TEAM_T )
   return 
PLUGIN_HANDLED 


oei 11-05-2011 11:09

Re: Only teror
 
Quote:

Originally Posted by Bugsy (Post 1590592)
PHP Code:

if ( cs_get_user_teamid ) != CS_TEAM_T )
   return 
PLUGIN_HANDLED 


Where I put it in this code?

Bugsy 11-05-2011 11:30

Re: Only teror
 
Use your brain a little. Think about where you want the block to occur.

oei 11-05-2011 11:37

Re: Only teror
 
i do this :

PHP Code:

   if(get_user_flags(id) & ADMIN_LEVEL_D)
   {
    
ColorChat(id,"You need be a Vip!"
    return 
PLUGIN_HANDLED;
   } 

And if i have in user.ini this flag i can not buy this and if i dont hav this flag i can buy this hoo i do only ho have the flag ADMIN_LEVEL_D can buy this ?


All times are GMT -4. The time now is 14:19.

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