AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to restrict kevlar? (https://forums.alliedmods.net/showthread.php?t=28759)

SuperDuper 05-22-2006 00:35

how to restrict kevlar?
 
:? In my plugin, when you enable it you get 255 armor, but if i use autobuy i buy armor and it goes back down to 100. SO what is a simple code that will restrict armor while the plugin is enabled?

here is my plugin

Code:
#include <amxmodx>     #include <amxmisc>     #include <fun>     #include <engine>   #include <cstrike>   #define PLUGIN "EpicMod"     #define VERSION "1.0"     #define AUTHOR "SuperDuper"   new bool:g_bEpicEnabled public plugin_init()     {         register_plugin(PLUGIN, VERSION, AUTHOR)               register_clcmd("amx_epicon", "cmd_epicon")       register_clcmd("amx_epicoff", "cmd_epicoff")             register_event("ResetHUD","fnEventResetHUD","be")     register_event("CurWeapon","fnEventCurWeapon","be") }   public cmd_epicon(id, level, cid)   {       if (!cmd_access(id, level, cid, 1))           return PLUGIN_HANDLED             new iPlayers[32],iPlayersnum     get_players(iPlayers,iPlayersnum,"a")           g_bEpicEnabled = true           for(new iCount = 0;iCount < iPlayersnum;iCount++)         fnEventResetHUD(iPlayers[iCount])           client_print(0,print_chat,"[AMXX] EpicMod has been enabled.")           return PLUGIN_HANDLED }   public cmd_epicoff(id, level, cid) {     if (!cmd_access(id, level, cid, 0))         return PLUGIN_HANDLED               register_concmd("amx_restrict","cmd_restrict",ADMIN_KICK,"kevlar")     register_concmd("amx_restrict","cmd_restrict",ADMIN_KICK,"kevlar&helmet")                 new iPlayers[32],iPlayersnum     get_players(iPlayers,iPlayersnum,"a")           g_bEpicEnabled = false           for(new iCount = 0;iCount < iPlayersnum;iCount++)         fnEventResetHUD(iPlayers[iCount])           client_print(0,print_chat,"[AMXX] EpicMod has been disabled.")           return PLUGIN_HANDLED }   public fnEventResetHUD(id)     if(g_bEpicEnabled)     {         set_user_footsteps (id, 1)           set_user_health(id, 255)           set_user_gravity (id, 0.20)           set_user_armor (id, 255)         }     else     {         set_user_footsteps (id, 0)           set_user_health(id, 100)           set_user_gravity (id, 1.0)           set_user_armor (id, 100)       } public fnEventCurWeapon(id)     if(g_bEpicEnabled)         set_user_maxspeed(id,0.0)

Thanks...

VEN 05-22-2006 03:34

Just use
Code:
server_cmd("amx_restrict on vest vesthelm")

Mini_Midget 05-22-2006 04:57

correct me if i'm wrong but isn't there a restriction for kevlar in the restmenu built in with amxx?
why not just use that instead?

Hawk552 05-22-2006 08:35

Quote:

Originally Posted by Mini_Midget
correct me if i'm wrong but isn't there a restriction for kevlar in the restmenu built in with amxx?
why not just use that instead?

:arrow:

Quote:

Originally Posted by VEN
Just use
Code:

server_cmd("amx_restrict on vest vesthelm")


SuperDuper 05-22-2006 09:32

do i replace what i already have?? im not sure where to put it

Hawk552 05-22-2006 09:38

Put it somewhere in epicon, and then put a copy of it except change "on" to "off" in the epicoff function.

SuperDuper 05-22-2006 09:41

k thanx


All times are GMT -4. The time now is 16:20.

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