AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to detect using func_tank (https://forums.alliedmods.net/showthread.php?t=153180)

Voi 03-19-2011 19:17

how to detect using func_tank
 
Im asking for the most efficient(in cpu usage) way to detect client starting to use func_tank and stopping using it.
Metamod prints something like "start using tank" and "stopped using tank" on listen server.

matsi 03-19-2011 20:50

Re: how to detect using func_tank
 
Code:
#include <amxmodx> #include <hamsandwich> #define PLUGIN  "func_tank test" #define AUTHOR  "matsi" #define VERSION "1.0" public plugin_init() {     register_plugin( PLUGIN, VERSION, AUTHOR )     RegisterHam( Ham_Use, "func_tank", "UseTank" ); } public UseTank( this, idcaller, idactivator, use_type ) {     if( !use_type )     {         client_print( idactivator, print_center, "stopped using tank" );     }     else     {         client_print( idactivator, print_center, "started using tank" );     } }
Don't know about efficiency thought.

Elusive138 03-21-2011 00:11

Re: how to detect using func_tank
 
If you want to stop it, just return HAM_SUPERCEDE.


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

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