im new to scripting
i have a simple code that prints a message when you're touching player.
problem is its spamming the message like crazy when touching.
how can i get it to print only one message and not lag the server?
code:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Touch, "player", "PlayerTouch");
// Add your code here...
}
public PlayerTouch(id, player) {
if( is_user_alive( id ) && is_user_alive( player ) && cs_get_user_team( id ) ==CS_TEAM_T && cs_get_user_team( player ) == CS_TEAM_CT ) { //if you are CT and touch T
new touch_target[32]
get_user_name(id, touch_target, 31);
client_print( player, print_chat, "touching: %s [terrorist]", touch_target );
}
return PLUGIN_CONTINUE;
}