AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need HELP with AWP pick up Restrict plugin (https://forums.alliedmods.net/showthread.php?t=62488)

andrius2006x 10-28-2007 08:42

Need HELP with AWP pick up Restrict plugin
 
Sory for my bad english.
I have made a plugin but it dont works It copile fine but not work.
So i think that anyone can help me :wink:

I want to write a plugin who will restrickt to pick up weapons what is on the ground only ADMINS can pick UP the weapons who are on the ground but other players cant pick up the AWP fromthe ground .

There is the code. Maybe the code is bad i dont know becouse I am a starting modder :)

If anyone can help me please help. :wink:
Thanks ..:wink:

There is the CODE.

Quote:


////////////////////////////////////////
// //
// AWP restriction plugin //
// //
// By Andriusxxx //
////////////////////////////////////////

#define CSW_P228 1
#define CSW_SCOUT 3
#define CSW_HEGRENADE 4
#define CSW_XM1014 5
#define CSW_C4 6
#define CSW_MAC10 7
#define CSW_AUG 8
#define CSW_SMOKEGRENADE 9
#define CSW_ELITE 10
#define CSW_FIVESEVEN 11
#define CSW_UMP45 12
#define CSW_SG550 13
#define CSW_GALI 14
#define CSW_GALIL 14
#define CSW_FAMAS 15
#define CSW_USP 16
#define CSW_GLOCK18 17
#define CSW_AWP 18
#define CSW_MP5NAVY 19
#define CSW_M249 20
#define CSW_M3 21
#define CSW_M4A1 22
#define CSW_TMP 23
#define CSW_G3SG1 24
#define CSW_FLASHBANG 25
#define CSW_DEAGLE 26
#define CSW_SG552 27
#define CSW_AK47 28
#define CSW_KNIFE 29
#define CSW_P90 30
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define ADMIN_LEVEL ADMIN_LEVEL_H
public plugin_modules()
{
require_module("fun")
require_module("cstrike")
}
public plugin_init(){
register_plugin("AWP tik V.I.P","1.0","Andriusxxx csZone.LT")
register_event("pasimti_ginkla","awp_tikrint" ,"b","1=18")
register_cvar("awp_only_for_admins", "1")
register_cvar("n_awp","1")
return PLUGIN_CONTINUE
}
public awp_tikrint()
{
if (!get_cvar_num("n_awp")) return PLUGIN_HANDLED

new id = read_data(0)
if(get_cvar_num("awp_only_for_admins") == 1 && access(id, ADMIN_LEVEL))
{
return PLUGIN_CONTINUE
}
client_cmd(id, "drop","weapon_awp")
client_print(id, print_center, "AWP is only for admins! Pick up another gun!")
return PLUGIN_CONTINUE
}

andrius2006x 10-28-2007 08:43

Re: Need HELP with AWP pick up Restrict plugin
 
Please help me ;)
And thanks if anyone help ;)

Alka 10-28-2007 08:52

Re: Need HELP with AWP pick up Restrict plugin
 
1st post - Today , 02:42 PM
2nd post - Today , 02:43 PM

lol! Don't bump you'r theards, wait until someone will response!

YamiKaitou 10-28-2007 16:25

Re: Need HELP with AWP pick up Restrict plugin
 
Also, there is no need to define the CSW_ values. They are already defined for you.

And, when is the event "pasimti_ginkla" called? And, what event is it?

andrius2006x 01-28-2008 09:29

Re: Need HELP with AWP pick up Restrict plugin
 
Are any plugin on this forum for amx restriction ?
I need plugin that only admins can have a weapon like AWP
Other players cant take this weapom from the ground only admins can buy ant pick up from the ground the some weapons./

Can anyone help me ?

Jheshka 01-30-2008 00:02

Re: Need HELP with AWP pick up Restrict plugin
 
Allow me to translate...

He would like a plugin that restricts awp usage (By a cvar, on/off)
Which when turned on will not affect admins.

By restriction of awp usage he means buying, and picking up. :)

[kirk]./musick` 01-30-2008 07:55

Re: Need HELP with AWP pick up Restrict plugin
 
I didn't know "pasimti_ginkla" was a CS event. :roll:

[X]-RayCat 01-30-2008 08:57

Re: Need HELP with AWP pick up Restrict plugin
 
PHP Code:

#include <amxmodx>
#include <amxmisc>
 
#define ADMIN_LEVEL ADMIN_LEVEL_H
 
new cv_awpforadmins
 
public plugin_init() {
    
register_plugin("PLUGIN""VERSION""AUTHOR");
    
register_event("CurWeapon""Event_CurWeapon""be")
    
cv_awpforadmins register_cvar("amx_awp_for_admins_only""1")
}
public 
Event_CurWeapon(id)

      new 
trash
      
new weapon get_user_weapon(id,trash,trash);
 
      new 
allowed
      
allowed get_pcvar_num(cv_awpforadmins);
 
      if(
allowed == && access(idADMIN_LEVEL))
      {
          return 
PLUGIN_CONTINUE;
      }
      else if (
weapon == CSW_AWP)
      {
          
client_cmd(id"drop");
      }
      return 
PLUGIN_HANDLED;
}
public 
client_command(id
{
      
//works only if awp is bought trought console :<
      
new arg[13];
      
read_argv(0arg 12)
 
      if (
equal("awp"arg )) 
      {
          
client_print(idprint_chat"[AMXX] You're not allowed to buy that weapon.");
          return 
PLUGIN_HANDLED;
      }
      return 
PLUGIN_CONTINUE;


Only works with pickup and console buy. Use restrict menu. :)

andrius2006x 02-11-2008 12:40

Re: Need HELP with AWP pick up Restrict plugin
 
Quote:

Originally Posted by Jheshka (Post 579776)
Allow me to translate...

He would like a plugin that restricts awp usage (By a cvar, on/off)
Which when turned on will not affect admins.

By restriction of awp usage he means buying, and picking up. :)


Thanks you very much for helping too. :wink:

andrius2006x 02-11-2008 12:41

Re: Need HELP with AWP pick up Restrict plugin
 
Thanks [X]-RayCat for helping....

And can you tell me what this event new trash
called for ?



All times are GMT -4. The time now is 01:23.

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