guys could someone help me please i realy don't know whats the problem the plugin compiles fine but when i join game it kicks me out "reliable over chan load or something" and it in the logs it asked me for debug and i added it but it keeps kicking me but not it saying i have something wrong with my give_item functions here is the hole code to see :)
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <fun>
#include <cstrike>
new const g_Weapons[26][20] = {
"weapon_usp",
"weapon_glock18",
"weapon_deagle",
"weapon_p228",
"weapon_elite",
"weapon_fiveseven",
"weapon_m3",
"weapon_xm1014",
"weapon_mp5navy",
"weapon_tmp",
"weapon_p90",
"weapon_mac10",
"weapon_ump45",
"weapon_famas",
"weapon_sg552",
"weapon_ak47",
"weapon_m4a1",
"weapon_aug",
"weapon_scout",
"weapon_awp",
"weapon_g3sg1",
"weapon_sg550",
"weapon_galil",
"weapon_m249",
"weapon_hegrenade",
"weapon_knife"
}
new const g_Ammos[26][20] = {
"ammo_45acp",
"ammo_9mm",
"ammo_50ae",
"ammo_357sig",
"ammo_9mm",
"ammo_57mm",
"ammo_buckshot",
"ammo_buckshot",
"ammo_9mm",
"ammo_9mm",
"ammo_57mm ",
"ammo_45acp",
"ammo_45acp",
"ammo_556nato",
"ammo_556nato",
"ammo_762nato",
"ammo_556nato",
"ammo_556nato",
"ammo_762nato",
"ammo_338magnum",
"ammo_762nato",
"ammo_556nato",
"ammo_556nato",
"ammo_556natobox",
"",
""
}
new const g_Models[26][20] = {
"w_usp",
"w_glock18",
"w_deagle",
"w_p228",
"w_elite",
"w_fiveseven",
"w_m3",
"w_xm1014",
"w_mp5navy",
"w_tmp",
"w_p90",
"w_mac10",
"w_ump45",
"w_famas",
"w_sg552",
"w_ak47",
"w_m4a1",
"w_aug",
"w_scout",
"w_awp",
"w_g3sg1",
"w_sg550",
"w_galil",
"w_m249",
"w_hegrenade",
"w_knife"
}
new g_level[33]
new enabled
new Spawn_Time
public plugin_init()
{
register_plugin("GunGame Mod","0.1","K007")
enabled = register_cvar("ggm_enabled","0")
Spawn_Time = register_cvar("ggm_spawntime","15")
register_concmd("ggm_active","Activation",0, " - ggm_active <1|0> 1 active, 0 desactive")
register_event("HLTV", "New_Round", "a", "1=0", "2=0")
register_event("DeathMsg","Death","a")
register_event("ResetHUD", "Player_Respawn", "b")
register_event("StatusIcon", "BuyZone", "be", "1=1", "1=2", "2=buyzone")
register_clcmd("drop","itemDrop")
set_task(30.0, "cleanup", 0, "", 0, "b")
}
public cleanup(id)
{
if(get_pcvar_num(enabled) == 1)
{
new ent
ent = entity_count()
client_print(0, print_chat, "[GunGameMod] %d Total Entites Are Found", ent)
new curent
curent = entity_count()
new ent1 = -1, ent2
new str[32], find[32], found
while(ent1)
{
ent1 = find_ent_by_class(ent1, "weaponbox")
if(ent1)
{
entity_get_string(ent1, EV_SZ_model, str, 32)
if(equali(str, "models/w_knife.mdl")){
copy(find, 32, "weapon_knife")
}
if(equali(str, "models/w_usp.mdl")){
copy(find, 32, "weapon_usp")
}
if(equali(str, "models/w_glock18.mdl")){
copy(find, 32, "weapon_glock18")
}
if(equali(str, "models/w_deagle.mdl")){
copy(find, 32, "weapon_deagle")
}
if(equali(str, "models/w_p228.mdl")){
copy(find, 32, "weapon_p228")
}
if(equali(str, "models/w_elite.mdl")){
copy(find, 32, "weapon_elite")
}
if(equali(str, "models/w_fiveseven.mdl")){
copy(find, 32, "weapon_fiveseven")
}
if(equali(str, "models/w_m3.mdl")){
copy(find, 32, "weapon_m3")
}
if(equali(str, "models/w_xm1014.mdl")){
copy(find, 32, "weapon_xm1014")
}
if(equali(str, "models/w_mp5.mdl")){
copy(find, 32, "weapon_mp5navy")
}
if(equali(str, "models/w_tmp.mdl")){
copy(find, 32, "weapon_tmp")
}
if(equali(str, "models/w_p90.mdl")){
copy(find, 32, "weapon_p90")
}
if(equali(str, "models/w_mac10.mdl")){
copy(find, 32, "weapon_mac10")
}
if(equali(str, "models/w_ump45.mdl")){
copy(find, 32, "weapon_ump45")
}
if(equali(str, "models/w_ak47.mdl")){
copy(find, 32, "weapon_ak47")
}
if(equali(str, "models/w_sg552.mdl")){
copy(find, 32, "weapon_sg552")
}
if(equali(str, "models/w_m4a1.mdl")){
copy(find, 32, "weapon_m4a1")
}
if(equali(str, "models/w_aug.mdl")){
copy(find, 32, "weapon_aug")
}
if(equali(str, "models/w_scout.mdl")){
copy(find, 32, "weapon_scout")
}
if(equali(str, "models/w_awp.mdl")){
copy(find, 32, "weapon_awp")
}
if(equali(str, "models/w_g3sg1.mdl")){
copy(find, 32, "weapon_g3sg1")
}
if(equali(str, "models/w_sg550.mdl")){
copy(find, 32, "weapon_sg550")
}
if(equali(str, "models/w_m249.mdl")){
copy(find, 32, "weapon_m249")
}
if(equali(str, "models/w_famas.mdl")){
copy(find, 32, "weapon_famas")
}
if(equali(str, "models/w_galil.mdl")){
copy(find, 32, "weapon_galil")
}
if(equali(str, "models/w_shield.mdl")){
copy(find, 32, "weapon_shield")
}
if(equali(str, "models/w_c4.mdl")){
copy(find, 32, "weapon_c4")
}
if(equali(str, "models/w_flashbang.mdl")){
copy(find, 32, "weapon_flashbang")
}
if(equali(str, "models/w_hegrenade.mdl")){
copy(find, 32, "weapon_hegrenade")
}
if(equali(str, "models/w_smokegrenade.mdl")){
copy(find, 32, "weapon_smokegrenade")
}
if(equali(str, "models/w_thighpack.mdl")){
copy(find, 32, "item_thighpack")
}
if(equali(str, "models/w_kevlar.mdl")){
copy(find, 32, "item_kevlar")
}
if(equali(str, "models/w_assault.mdl")){
copy(find, 32, "item_assaultsuit")
}
if(equali(str, "models/w_medkit.mdl")){
copy(find, 32, "item_healthkit")
}
if(equali(str, "models/w_battery.mdl")){
copy(find, 32, "item_battery")
}
if(equali(str, "models/w_longjump.mdl")){
copy(find, 32, "item_longjump")
}
ent2 = -1
found = 0
while(ent2){
ent2 = find_ent_by_owner(ent2, find, ent1)
if(ent2){
found = 1
remove_entity(ent2)
}
}
if(found){
remove_entity(ent1)
}
}
}
new diff
diff = curent
curent = entity_count()
diff = diff - curent
client_print(0, print_chat, "[GunGameMod] Removed %d Entities | Total: %d", diff, curent)
}
}
public Activation(id)
{
if(is_user_admin(id))
{
new argv[32]
read_argv(1,argv,32)
if(equali(argv,"0",1))
{
set_hudmessage(225, 0, 0, 0.31, 0.26, 0, 6.0, 12.0, 0.01, 0.1, 2)
show_hudmessage(0,"GunGame Mod Has Been Deactivated....")
set_pcvar_num(enabled, 0)
server_cmd("sv_restartround 5")
}
else if(equali(argv,"1",1))
{
set_hudmessage(85, 255, 85, 0.31, 0.26, 0, 6.0, 12.0, 0.01, 0.1, 2)
show_hudmessage(0,"GunGame Mod Has Been Activated!!!!")
set_pcvar_num(enabled, 1)
server_cmd("sv_restartround 2")
g_level[id] = 0
}
else
{
console_print(id, "ggm_active <1|0> --- 1 active, 0 desactive")
}
}
else
{
console_print(id, "[AMXX] You have no access to that commmand!")
}
return PLUGIN_CONTINUE
}
public Death()
{
new killer = read_data(1)
new victim = read_data(2)
if(get_pcvar_num(enabled) == 1 && get_pcvar_num(Spawn_Time) !=0)
{
client_print(victim, print_chat, "[GunGameMod] You Will Respawn in %s seconds", get_pcvar_num(Spawn_Time))
set_task(get_pcvar_float(Spawn_Time), "Respawn", victim)
new VicLevel = g_level[victim]
set_task(0.1,"removeWeapon", VicLevel)
strip_user_weapons(killer)
new KillaLevel = g_level[killer]
set_task(0.1,"removeWeapon", KillaLevel)
g_level[killer] = g_level[killer]+1
if(g_level[killer] > 25 )
{
g_level[killer]=25
winna(killer)
}
giveWeapon(killer)
cs_set_user_money(killer,0)
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public Respawn(id)
{
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
return PLUGIN_HANDLED
if(!is_user_alive(id))
return PLUGIN_HANDLED
spawn(id)
cs_set_user_money(id, 0)
return PLUGIN_HANDLED
}
public BuyZone(id)
{
if (!get_cvar_num("gg_active"))
return PLUGIN_CONTINUE
message_begin(MSG_ONE,get_user_msgid("StatusIcon"), {0,0,0}, id)
write_byte(0)
write_string("buyzone")
message_end()
return PLUGIN_HANDLED
}
public dropWeapon (id)
{
new Cmd[60]
format(Cmd, 59, "drop %s", g_Weapons[g_level[id]])
client_cmd(id, Cmd)
}
public giveWeapon(id)
{
give_item(id, g_Weapons[g_level[id]])
if(g_level[id] < 24)
{
give_item(id, g_Ammos[g_level[id]])
give_item(id, g_Ammos[g_level[id]])
give_item(id, g_Ammos[g_level[id]])
give_item(id, g_Ammos[g_level[id]])
}
}
public removeWeapon(level)
{
new Model[64]
format(Model, 63, "models/%s", g_Models[level])
new Weapon = engfunc(EngFunc_FindEntityByString, -1, "model", Model)
while(Weapon > 0)
{
engfunc(EngFunc_RemoveEntity, Weapon)
Weapon = engfunc(EngFunc_FindEntityByString, Weapon, "model", Model)
}
return PLUGIN_CONTINUE
}
public itemDrop(id)
{
if(get_pcvar_num(enabled) == 1)
return PLUGIN_CONTINUE
set_task(0.2,"removeWeapon", g_level[id])
return PLUGIN_CONTINUE
}
public Player_Respawn(id)
{
cs_set_user_money(id,0)
if (get_user_team(id) == 1)
{
engclient_cmd(id,"drop","weapon_glock18")
engclient_cmd(id,"drop","weapon_knife")
engclient_cmd(id, "drop", "weapon_c4")
}
else if (get_user_team(id) == 2)
{
engclient_cmd(id,"drop","weapon_glock18 ")
engclient_cmd(id,"drop","weapon_knife")
}
give_item(id,"item_assaultsuit")
set_task(0.1,"giveWeapon",id)
return PLUGIN_CONTINUE
}
public winna(id)
{
new Name[33]
get_user_name(id, Name, 32)
set_user_hitzones(0,0,0)
client_print(0, print_chat, "[GunGameMod] %s Has Won The Game GG!!!!!!!", Name)
set_hudmessage(0, 0, 255, 0.2, 0.35, 0, 6.0, 12.0)
show_hudmessage(0, "[GunGameMod] %s Has Won The Game GG!", Name)
Restart()
}
public Restart()
{
server_cmd("sv_restartround 1")
client_print(0, print_center,"[GunGameMod] Restarting in 10 seconds...")
client_print(0, print_center,"[GunGameMod] Pre-Pare to Battle")
server_cmd("sv_restartround 10")
}
public New_Round(id)
{
if(get_pcvar_num(enabled) == 1)
{
g_level[id] = 0
client_print(id, print_chat, "[GunGameMod] Gun Game Mod is enabled so be pre-pared and enjoy!")
}
return PLUGIN_HANDLED
}
public client_connect(id){
g_level[id] = 0
}
public client_disconnect(id){
g_level[id] = 0
}