Raised This Month: $ Target: $400
 0% 

Flag "d" doesn't work with the plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 08-10-2008 , 09:20   Flag "d" doesn't work with the plugin
Reply With Quote #1

Hi,

I have admins with the flag "d"
and the plugin is configured so admins with ADMIN_BAN is allowed to use it, but it doesn't work.
PHP Code:
/* AMXX Mod script. 

* Admin Weapon For Sven Coop 3.0
*  by SniperBeamer 
*  ported to SvenCoop by Girthesniper
*  Converted to AMXx by Girthesniper 

*  AIM:Gir489 
*  MSNM:[email protected] //I swear this is a MSNM 
*  YIM:Gir489 //Never on it 
*  IRC:irc.gamesnet.net #Girthesniper 

*  No support via Instant Messenger or IRC service. //This does NOT include the AMXx irc channel 


* Description: Give clients weapons and acessories. This has been tested and works on a Condition Zero server by me. 

* Settings: amx_weaponmsg (0/1) - announces when a player gets a weapon. 

* Usage: amx_weapon <authid, nick, @team, @all or #userid> <weapon #> 

* v1.0
*      Added svencoop stuff.

*/
#include <amxmodx>
#include <amxmisc>
#include <fun>
public plugin_init()
{
   
register_plugin("Admin Weapon II","Build 3","SniperBeamer & Girthesniper"
   
register_cvar("amx_weaponmsg","0")
   
register_concmd("amx_weapon","admin_weapon",ADMIN_BAN,"<authid, nick, @team, @all or #userid> <weapon #>")
}
public 
admin_weapon(id,level,cid)
{
   if ( !
cmd_access(id,level,cid,3) )
      return 
PLUGIN_HANDLED
   
new arg1[32],arg2[8],weapon
   read_argv
(1,arg1,31)
   
read_argv(2,arg2,7)
   
weapon str_to_num(arg2)
   if ( 
equali(arg1,"@all") )
   {
      new 
plist[32],pnum
      get_players
(plist,pnum,"a")
      if (
pnum==0)
      {
         
console_print(id,"[AMXX] There are no clients")
         return 
PLUGIN_HANDLED
      
}
      for (new 
i=0i<pnumi++)
            if ( !
give_weapon(plist[i],weapon) )
            {
               
console_print(id,"[AMXX] Gave all players the weapon %d",weapon)
            }
      
console_print(id,"[AMXX] Gave all players the weapon %d",weapon)
      if (!
get_cvar_num("amx_weaponmsg")) return PLUGIN_HANDLED
      set_hudmessage
(10,200,10,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
      
show_hudmessage(0,"All players have been given a weapon!")
   }
   else if ( 
arg1[0]=='@' )
   {
      new 
plist[32],pnum
      get_players
(plist,pnum,"ae",arg1[1])
      if ( 
pnum==)
      {
         
console_print(id,"[AMXX] No clients in such team")
         return 
PLUGIN_HANDLED
      
}
      for (new 
i=0i<pnumi++)
            
give_weapon(plist[i],weapon)
      
console_print(id,"[AMXX] Gave all %ss the weapon %d",arg1[1],weapon)
      if ( 
get_cvar_num("amx_weaponmsg") )
      {
         if (
equali(arg1[1],"CT")) set_hudmessage(200,20,0,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
         else 
set_hudmessage(0,20,200,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
         
show_hudmessage(0,"The %ss have been given a weapon!",arg1[1])
      }
   }
   else
   {
      new 
pName[32]
      new 
player cmd_target(id,arg1,6)
      if (!
player) return PLUGIN_HANDLED
      give_weapon
(player,weapon)
      
get_user_name(player,pName,31)
      
console_print(id,"[AMXX] Gave %s the weapon %d",pName,weapon)
      if (
get_cvar_num("amx_weaponmsg"))
      {
         
set_hudmessage(10,200,10,-1.0,0.30,0,6.0,6.0,0.5,0.15,1)
         
show_hudmessage(0,"%s has been given a weapon!",pName)
      }
   }
   return 
PLUGIN_HANDLED
}
give_weapon(id,weapon)

   switch (
weapon
   { 
      
//weapons in order
      
case 1:{ 
         
give_item(id,"weapon_crowbar")
      }
      case 
2:{
  
give_item(id,"weapon_pipewrench")
      } 
      case 
3:{ 
         
give_item(id,"weapon_glock"
         
give_item(id,"ammo_glockclip"
         
give_item(id,"ammo_glockclip"
         
give_item(id,"ammo_glockclip"
         
give_item(id,"ammo_glockclip"
         
give_item(id,"ammo_glockclip"
         
give_item(id,"ammo_glockclip"
         
give_item(id,"ammo_glockclip"
         
give_item(id,"ammo_glockclip"
  
give_item(id,"ammo_glockclip")
         
give_item(id,"ammo_glockclip"
         
give_item(id,"ammo_glockclip"
  
give_item(id,"ammo_glockclip")
         
give_item(id,"ammo_glockclip"
         
give_item(id,"ammo_glockclip"
  
give_item(id,"ammo_glockclip")
      }
      case 
4:{
  
give_item(id,"weapon_shotgun")
  
give_item(id,"ammo_buckshot")
  
give_item(id,"ammo_buckshot")
  
give_item(id,"ammo_buckshot")
  
give_item(id,"ammo_buckshot")
  
give_item(id,"ammo_buckshot")
  
give_item(id,"ammo_buckshot")
  
give_item(id,"ammo_buckshot")
  
give_item(id,"ammo_buckshot")
  
give_item(id,"ammo_buckshot")
  
give_item(id,"ammo_buckshot")
  
give_item(id,"ammo_buckshot")
      } 
      case 
5:{
  
give_item(id,"weapon_mp5")
  
give_item(id,"ammo_mp5clip")
  
give_item(id,"ammo_mp5clip")
  
give_item(id,"ammo_mp5clip")
  
give_item(id,"ammo_mp5clip")
  
give_item(id,"ammo_mp5clip")
  
give_item(id,"ammo_ARgrenades")
  
give_item(id,"ammo_ARgrenades")
  
give_item(id,"ammo_ARgrenades")
  
give_item(id,"ammo_ARgrenades")
  
give_item(id,"ammo_ARgrenades")
      }
      case 
6:{
  
give_item(id,"weapon_357")
  
give_item(id,"ammo_357")
  
give_item(id,"ammo_357")
  
give_item(id,"ammo_357")
  
give_item(id,"ammo_357")
  
give_item(id,"ammo_357")
  
give_item(id,"ammo_357")
  
give_item(id,"ammo_357")
      }
      case 
7:{
         
give_item(id,"weapon_crossbow"
         
give_item(id,"ammo_crossbow"
         
give_item(id,"ammo_crossbow"
         
give_item(id,"ammo_crossbow"
         
give_item(id,"ammo_crossbow")
  
give_item(id,"ammo_crossbow")
  
give_item(id,"ammo_crossbow")
  
give_item(id,"ammo_crossbow")
         
give_item(id,"ammo_crossbow")
  
give_item(id,"ammo_crossbow")
  
give_item(id,"ammo_crossbow")
  
give_item(id,"ammo_crossbow")
  
give_item(id,"ammo_crossbow")
      }
      case 
8:{
  
give_item(id,"weapon_crowbar_electric")
      }
      case 
9:{ 
         
give_item(id,"weapon_handgrenade"
         
give_item(id,"weapon_handgrenade")
      } 
      case 
10:{ 
         
give_item(id,"weapon_tripmine"
         
give_item(id,"weapon_tripmine"
         
give_item(id,"weapon_tripmine"
         
give_item(id,"weapon_tripmine"
         
give_item(id,"weapon_tripmine")
      }
      case 
11:{ 
  
give_item(id,"weapon_uzi")
  
give_item(id,"weapon_uziakimbo")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
  
give_item(id,"ammo_glockclip")
      } 
      case 
12:{ 
         
give_item(id,"weapon_rpg")
         
give_item(id,"rpgclip")
         
give_item(id,"rpgclip")
  
give_item(id,"rpgclip")
  
give_item(id,"rpgclip")
      } 
      case 
13:{ 
         
give_item(id,"weapon_snark"
         
give_item(id,"weapon_snark"
         
give_item(id,"weapon_snark")
      } 
      case 
14:{ 
         
give_item(id,"weapon_hornetgun")
      } 
      case 
15:{ 
         
give_item(id,"weapon_satchel"
         
give_item(id,"weapon_satchel"
         
give_item(id,"weapon_satchel"
         
give_item(id,"weapon_satchel"
         
give_item(id,"weapon_satchel"
      } 
      case 
16:{ 
         
give_item(id,"weapon_sniperrifle"
         
give_item(id,"ammo_762")
         
give_item(id,"ammo_762")
         
give_item(id,"ammo_762")
      } 
      case 
17:{
  
give_item(id,"weapon_minigun"
  
give_item(id,"ammo_556")
  
give_item(id,"ammo_556")
  
give_item(id,"ammo_556")
  
give_item(id,"ammo_556")
  
give_item(id,"ammo_556")
      }
      case 
18:{ 
         
give_item(id,"weapon_gauss")
         
give_item(id,"ammo_gaussclip")
         
give_item(id,"ammo_gaussclip")
         
give_item(id,"ammo_gaussclip")
         
give_item(id,"ammo_gaussclip")
         
give_item(id,"ammo_gaussclip"
      }
      case 
19:{
  
give_item(id,"weapon_egon")
         
give_item(id,"ammo_gaussclip")
         
give_item(id,"ammo_gaussclip")
         
give_item(id,"ammo_gaussclip")
         
give_item(id,"ammo_gaussclip")
         
give_item(id,"ammo_gaussclip"
      }
      case 
20:{
  
give_item(id,"item_longjump")
      }
      case 
21:{
  
give_item(id,"item_healthkit")
  
give_item(id,"item_healthkit")
  
give_item(id,"item_healthkit")
  
give_item(id,"item_healthkit")
  
give_item(id,"item_battery")
  
give_item(id,"item_battery")
  
give_item(id,"item_battery")
  
give_item(id,"item_battery")
      }
      default: return 
false 
   

   return 
true 

Rirre is offline
 


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 05:39.


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