Hey guys, in another forum made me the mod.
but, have some bug, you can fix it?:
sometimes players has weapons from last round can shot 1 bullet and then its change to knife, i don't want people can shot 1 bullet in this 10 seconds.
Code:
PHP Code:
#include <amxmodx>
#define TASK_COUNT 25020
new const PLUGIN [] = "Weapons Dealy"
new const VERSION [] = "1.0"
new const AUTHOR [] = "reNN"
new g_Count, bool: g_StripWep;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_logevent("EventRoundStart", 2, "1=Round_Start");
register_event("TextMsg", "EventRestartRound", "a", "2=#Game_will_restart_in")
register_event( "CurWeapon", "EventCurWeapon", "be", "2!29" );
}
public EventRoundStart()
{
g_StripWep = true;
g_Count = 10;
startCount( );
}
public EventRestartRound()
{
g_Count = 0;
g_StripWep = false;
remove_task( TASK_COUNT );
}
public EventCurWeapon( id ) {
if( g_StripWep )
{
engclient_cmd( id, "weapon_knife" );
client_print( id, print_center, "try again more %d seconds !", g_Count);
}
return PLUGIN_CONTINUE;
}
public startCount( )
{
switch( g_Count )
{
case 0:
{
g_StripWep = false
remove_task( TASK_COUNT );
}
case 1..10:
{
set_task( 1.0, "startCount", TASK_COUNT)
}
}
if( g_Count != 0 ) {
--g_Count
}
}