AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Drop awp help... (https://forums.alliedmods.net/showthread.php?t=3193)

kaksi 06-29-2004 12:34

Drop awp help...
 
I use this plugin cause i like that the players that havn't read the rules get really angry when the awp they just bought isn't usable....

Code:

/* AMX(x) Mod script.
*
* (c) Copyright 2002, SuicideDog
* This file is provided as is (no warranties).
* Simple AWP restriction for CS (this works for 1.6)
*/

#include <amxmodx>

public check_awp(id) {
      if (get_cvar_num("sv_noawp")!=1) return PLUGIN_CONTINUE
      new llama = read_data(0) 
      client_print(llama,print_center,"AWPs are not allowed. Find a real gun!")
      client_cmd(llama,"weapon_awp;wait;wait;wait;drop")
      return PLUGIN_CONTINUE
}

public plugin_init(){
  register_plugin("Drop Awp","0.1","SuicideDog")
  register_event("WeapPickup","check_awp","b","1=18")
  register_cvar("sv_noawp","1")
  return PLUGIN_CONTINUE
}

I guess it's this line that register the event of a awp pickup... and the id opf the awp is 1=18? Am I right?

Code:

register_event("WeapPickup","check_awp","b","1=18")
What are the id's of the other sniper rifles? I want to enable this for some of the other rifles...

Is there a list of alla availible weapons?

Ryan 06-30-2004 04:10

Quote:

Originally Posted by amxconst.inc
/* Id of weapons in CS */
#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

Also, a more efficient way of dropping the weapon is this command:

Code:
client_cmd( id, "drop weapon_awp" );

KiN | SuicideDog 06-30-2004 12:51

ya that would be a better way. I wrote that a long time ago .. and it was my first plugin


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

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