From d14c107db1e6ad6b528d162441141fd5afb7f859 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 19 Sep 2004 00:52:15 +0000 Subject: [PATCH] Fixed some include bugs Fixed adminslots not showing right slots on connect Fixed RTEs on wrong team --- plugins/adminslots.sma | 6 +++++- plugins/cstrike/restmenu.sma | 5 ++++- plugins/include/dodfun.inc | 5 ++++- plugins/include/ns2amx.inc | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/plugins/adminslots.sma b/plugins/adminslots.sma index fab0a201..eb55097d 100755 --- a/plugins/adminslots.sma +++ b/plugins/adminslots.sma @@ -50,6 +50,10 @@ public plugin_init() { random_num('A','Z') , random_num('A','Z') ,random_num('A','Z'),random_num('A','Z') ) register_clcmd( g_cmdLoopback, "ackSignal" ) + new maxplayers = get_maxplayers() + new players = get_playersnum(1) + new limit = maxplayers - get_cvar_num("amx_reservation") + setVisibleSlots(players, maxplayers, limit) } public ackSignal(id) { @@ -96,4 +100,4 @@ setVisibleSlots( players , maxplayers , limit ) set_cvar_num( "sv_visiblemaxplayers" , num ) } -#endif \ No newline at end of file +#endif diff --git a/plugins/cstrike/restmenu.sma b/plugins/cstrike/restmenu.sma index 51f52b94..a30adb3a 100755 --- a/plugins/cstrike/restmenu.sma +++ b/plugins/cstrike/restmenu.sma @@ -509,6 +509,9 @@ public cmdMenu(id,level,cid){ } checkRest(id,menu,key){ + new team = get_user_team(id) + if (team != 1 && team != 2) + return PLUGIN_HANDLED if ( g_blockPos[ (menu * 8 + key) + (get_user_team(id) - 1) * 56 ] ){ engclient_cmd(id,"menuselect","10") client_print(id,print_center, g_Restricted ) @@ -659,4 +662,4 @@ public plugin_init() { format(g_saveFile,63,"%s/weaprest.ini",configsDir) #endif loadSettings(g_saveFile) -} \ No newline at end of file +} diff --git a/plugins/include/dodfun.inc b/plugins/include/dodfun.inc index 0bb5c891..8d9b6b7f 100755 --- a/plugins/include/dodfun.inc +++ b/plugins/include/dodfun.inc @@ -15,7 +15,7 @@ /* Function is called after grenade throw */ forward grenade_throw(index,greindex,wId); -/* Example: for full stamina use set_player_stamina(1,STAMINA_SET,100,100) */ +/* Example: for full stamina use dod_player_stamina(1,STAMINA_SET,100,100) */ /* value is from 0 - 100 */ native dod_set_stamina(index,set=STAMINA_SET,minvalue=0,maxvalue=100); @@ -53,7 +53,10 @@ native dod_get_pl_teamname(index,szName[],len); /* Returns 1 is player weapon is deployed (bar,mg..) */ native dod_is_deployed(index); +/*Sets the ammo of the specified weapon entity id */ native dod_set_user_ammo(index,wid,value); + +/*Gets the ammo of the specified weapon entity id */ native dod_get_user_ammo(index,wid); diff --git a/plugins/include/ns2amx.inc b/plugins/include/ns2amx.inc index 40d0bb72..4b29e387 100755 --- a/plugins/include/ns2amx.inc +++ b/plugins/include/ns2amx.inc @@ -53,7 +53,7 @@ stock gpgobals_time() return halflife_time() stock get_range(ida, idb) - return entity_get_range(ida, idb) + return entity_range(ida, idb) stock supercede() return 0 @@ -210,7 +210,7 @@ stock ns2amx_gethives() /* Returns 1 if the two entities are within the given range. */ stock ns2amx_inrange(ida,idb,range) { - if (entity_get_range(ida,idb) <= range) + if (entity_range(ida,idb) <= range) return 1 return 0 }