This is a compilation of examples, explanations, and answers for commonly asked questions / issues. The Countdown Code: #include #define TASKID 1996 #define SECONDS 10 new iSeconds public plugin_init() { register_plugin( "Countdown Example", "1.0", "Wrecked" ) register_logevent( "LogEventRoundStart", 2, "1=Round_Start" ) } public LogEventRoundStart() { if( task_exists( TASKID ) ) remove_task( TASKID ) iSeconds = SECONDS set_task( 1.0, "TaskShowCountdown", TASKID, _, _, "a", SECONDS ) } public TaskShowCountdown() { set_hudmessage( 120, 120, 120, 0.50, 0.50, 0, 0.1, 0.8, 0.1, 0.1, -1 ) show_hudmessage( 0, "Seconds Remaining: %i", iSeconds-- ) } Detecting Kill/Headshot Streaks Code: #include new Headshots[33] new Kills[33] public plugin_init() { register_plugin( "How To Keep Kill Counts", "1.0", "Wrecked" ) register_event( "DeathMsg", "EventDeathMsg", "a" ) register_logevent( "LogEventRoundStart", 2, "1=Round_Start" ) } public EventDeathMsg() { new killer = read_data( 1 ) new victim = read_data( 2 ) Headshots[victim] = 0 Kills[victim] = 0 Kills[killer]++ if( read_data( 3 ) ) // headshot Headshots[killer]++ // Kills holds kills of each player // Headshots holds headshots } public LogEventRoundStart() { arrayset( Headshots, 0, 33 ) arrayset( Kills, 0, 33 ) } Once Every x Rounds Code: #include #define ROUND_INTERVAL 4 new iRound public plugin_init() { register_plugin( "Do Something Every X Rounds", "1.0", "Wrecked" ) register_logevent( "LogEventRoundStart", 2, "1=Round_Start" ) } public LogEventRoundStart() { if( ( ++iRound % ROUND_INTERVAL ) == 1 ) // do whatever you need to do here } Blocking Weapon Pickup Code: #include #include public plugin_init() { register_plugin( "Block Weapon Pickup", "1.0", "Wrecked" ) new classname[20] // weapon_smokegrenade (19) + 1 for( new i = CSW_P228; i <= CSW_P90; i++ ) { if ( get_weaponname( i, classname, charsmax( classname ) ) ) { RegisterHam( Ham_Item_Deploy, classname, "HamItemDeployPre", 0 ) /* Other forwards that you could've used: * Ham_AddPlayerItem * Ham_Item_CanDeploy */ } } } public HamItemDeployPre( weapon ) { return HAM_SUPERCEDE; // blocks function call } Properly Removing Buyzones (by Exolent[jNr]) Code: #include < amxmodx > #include < engine > #include < fakemeta > new const info_map_parameters[ ] = "info_map_parameters"; new g_hSpawn; public plugin_precache( ) { new iEntity = create_entity( info_map_parameters ); DispatchKeyValue( iEntity, "buying", "3" ); DispatchSpawn( iEntity ); g_hSpawn = register_forward( FM_Spawn, "FwdSpawn" ); } public FwdSpawn( iEntity ) { static szClassname[ 32 ]; entity_get_string( iEntity, EV_SZ_classname, szClassname, 31 ); if( equal( szClassname, info_map_parameters ) ) { remove_entity( iEntity ); return FMRES_SUPERCEDE; } return FMRES_IGNORED; } public plugin_init( ) { if( g_hSpawn > 0 ) { unregister_forward( FM_Spawn, g_hSpawn ); } } Properly Removing an Entity at Plugin Start (by Alucard^) Code: #include #include new const g_RemoveEntity[] = "classname_here"; public plugin_precache() { register_plugin("Fine", "and", "you?"); // Remember to do this in plugin_precache, if you // do this in plugin_init( ) this will not work! register_forward(FM_Spawn, "HookFmSpawn"); } public HookFmSpawn(iEntity) { if(!pev_valid(iEntity) ) return FMRES_IGNORED; static szClassName[32]; pev(iEntity, pev_classname, szClassName, 31); if(equali(szClassName, g_RemoveEntity) ) { engfunc(EngFunc_RemoveEntity, iEntity); return FMRES_SUPERCEDE; } return FMRES_IGNORED; } What is the proper way to respawn someone? Well, there are two methods that are correct and efficient. Code: // GOOD, hamsandwich ExecuteHamB( Ham_CS_RoundRespawn, playerindex ) // GOOD, fakemeta set_pev( playerindex, pev_deadflag, DEAD_RESPAWNABLE ) // BAD, fun // This is usable, but requires a fix that really isn't worth it. spawn( playerindex ) // BAD, cstrike cs_user_spawn( playerindex ) What module should I use for my large plugin? Fakemeta or engine? You should use whatever module gets the job done. The actual efficiency impact between including either is very trivial. Don't be hesitant to include both if you need both to get what you need done properly. I've compiled my plugin and the loose indentation warning has come up. What is this and how can I fix it? This warning shows up whenever you indent your lines with spaces AND tabs. Conform to using one style; I personally use tabs because they're much easier. How do I dynamically add values into my menu title / items? Code: menufunc() { new info[128] formatex( info, 127, "Welcome to the Point Shop^nYour Points: %i", iVariableForPoints[id] ) new menu = menu_create( info, "HandlerFunction" ) // rest of menu code } How to remove properly the BuyZones in the map: Code: #include #include public plugin_precache() { register_plugin("How", "are", "you?"); // If i am not wrong, this must be made in plugin_precache( ) new iEnt; iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_map_parameters") ); SetKeyValue(iEnt, "buying", "3", "info_map_parameters"); dllfunc(DLLFunc_KeyValue, iEnt, 0); } SetKeyValue(iEnt, const szKey[], const szValue[], const szClassName[]) { set_kvd(0, KV_ClassName, szClassName); set_kvd(0, KV_KeyName, szKey); set_kvd(0, KV_Value, szValue); set_kvd(0, KV_fHandled, 0); dllfunc(DLLFunc_KeyValue, iEnt, 0); } How to remove properly an entity in the map: Code: #include #include new const g_RemoveEntity[] = "func_push"; public plugin_precache() { register_plugin("Fine", "and", "you?"); // Remember to do this in plugin_precache, if you // do this in plugin_init( ) this will not work! register_forward(FM_Spawn, "HookFmSpawn", 1); } public HookFmSpawn(iEntity) { if(!pev_valid(iEntity) ) return FMRES_IGNORED; new szClassName[32]; pev(iEntity, pev_classname, szClassName, 31); if(equali(szClassName, g_RemoveEntity) ) { engfunc(EngFunc_RemoveEntity, iEntity); return FMRES_SUPERCEDE; } return FMRES_IGNORED; } This is really simple but, for some people that want to do something at the first spawn only, or at the first event (round start, or whatever): Code: #include #include #define PLUGIN "First Spawn" #define AUTHOR "Alucard" #define VERSION "0.0.1" new bool:FirstSpawn[33]; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); RegisterHam(Ham_Spawn, "player", "HookPlrSpawn", 1); } public client_connect(id) FirstSpawn[id] = true; public HookPlrSpawn(id) { if(FirstSpawn[id]) { // do stuff here, that you only want // to do at the first spawn FirstSpawn[id] = false; } }