View Single Post
Author Message
heroicpower7613
Member
Join Date: Nov 2016
Old 01-06-2017 , 14:20   Ham_Touch spam issue
Reply With Quote #1

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(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Touch"player""PlayerTouch");
    
// Add your code here...
}

public 
PlayerTouch(idplayer) {
    
    if( 
is_user_aliveid ) && is_user_aliveplayer ) && cs_get_user_teamid ) ==CS_TEAM_T && cs_get_user_teamplayer ) == CS_TEAM_CT ) { //if you are CT and touch T
        
        
new touch_target[32]
        
get_user_name(idtouch_target31);
        
client_printplayerprint_chat"touching: %s [terrorist]"touch_target );
    }
    return 
PLUGIN_CONTINUE;

heroicpower7613 is offline