Raised This Month: $ Target: $400
 0% 

Scripting plugin does not function in game.AMXX help!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
dragonbolt
Member
Join Date: Mar 2009
Old 04-05-2009 , 20:25   Scripting plugin does not function in game.AMXX help!
Reply With Quote #1

ok i need some help (alot of help) heres my script. its does work at all. if someone could rewrite it that would be greatly helpful so i start my community.

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <engine>
#include <fakemeta>
new mod_name[32] = "WARFAREGAMERS"
new bool:buying
new hudsync
#define PLUGIN "Warfare Gamers"
#define AUTHOR "WarLord"
#define VERSION "1.5"

//Sets the sky you want for your server
#define SKYNAME "space"
#define Keysmenu_1 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<9)
#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
#define SLOT_PRIMARY 1
#define SLOT_SECONDARY 2
#define SLOT_KNIFE 3
#define SLOT_GRENADE 4
#define SLOT_C4 5
#define PRIMARY_WEAPONS_BIT_SUM ((1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10 )|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)| (1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1 <<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<< CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW _SG552)|(1<<CSW_AK47)|(1<<CSW_P90))
#define SECONDARY_WEAPONS_BIT_SUM ((2<<CSW_P22|(2<<CSW_ELITE)|(2<<CSW_FIVESEV EN)|(CSW_USP)|(1<<CSW_GLOCK1|(1<<CSW_DEAGLE ))
stock g_WeaponSlots[] = { 0, 2, 0, 1, 4, 1, 5, 1, 1, 4, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1 ,1, 4, 2, 1, 1, 3, 1 }
stock g_MaxBPAmmo[] = { 0, 52, 0, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 21, 90, 120, 90, 2, 35, 90, 90, 0, 100 }
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_cvar(PLUGIN,VERSION,FCVAR_SERVER)

register_dictionary("warfaregamers.txt")

register_logevent("logevent_round_start",2, "1=Round_Start")
register_logevent("logevent_round_end", 2, "1=Round_End")

register_forward(FM_ClientUserInfoChanged,"fw _info")
register_forward(FM_PlayerPostThink,"fw_postt hink")
register_forward(FM_Touch,"fw_Touch");
register_forward( FM_EmitSound, "fw_EmitSound" )
register_forward(FM_CmdStart, "fw_Cmd")
register_forward(FM_GetGameDescription,"GameD esc")


register_event("ResetHUD","event_hud_reset", "be")
register_event("TextMsg","event_restart_attem pt", "a", "2=#Game_will_restart_in")
register_event("CurWeapon","event_cur_weapon" ,"be", "1=1")
register_event("Damage","event_damage_scream" ,"be","2!0","3=0")
register_event("Damage", "event_damage", "be", "2!0","3=0","4!0")
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")

server_cmd("sv_skyname %s", SKYNAME)
server_cmd("sv_maxspeed 1000")

register_clcmd("say","clcmd_say_extra")
register_clcmd("say","clcmd_say")

register_clcmd("fullupdate","clcmd_fullupdate ")


register_menucmd(register_menuid("Buy Menu"), Keysmenu_1, "buy_menu")

format(mod_name, 31, "WARAREGAMERS %s", VERSION)
hudsync = CreateHudSyncObj()

return PLUGIN_CONTINUE
}
public GameDesc()
{
forward_return(FMV_STRING, mod_name)

return FMRES_SUPERCEDE
}
public plugin_precache() {
precache_model("models/player/admin_ct/admin_ct.mdl")
precache_model("models/player/admin_t/admin_t.mdl")
return PLUGIN_CONTINUE
}
public resetModel(id, level, cid) {
if (get_user_flags(id) & ADMIN_KICK) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "admin_t")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "admin_ct")
}
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public clcmd_say(id)
{
if ( !is_user_alive(id) )
return PLUGIN_HANDLED

static ARGS[15]
read_args(ARGS,14)

remove_quotes(ARGS)

if(equali(ARGS,"/info"))
{
info(id)
}
else if (equali(ARGS,"/bm"))
{
if ( !is_user_alive(id) )
{
client_print(id, print_center, "%L", id, "BUY_ALIVE")
return PLUGIN_HANDLED
}
else if ( !cs_get_user_buyzone(id) )
{
client_print(id, print_center, "%L", id, "BUY_BUYZONE")
return PLUGIN_HANDLED
}
else if (!buying)
{
new Float:time_buy = get_cvar_float("mp_buytime") * 600
client_print(id, print_center, "%L", id, "BUY_TIME", floatround(time_buy))
return PLUGIN_HANDLED
}
else
{
show_menu(id, Keysmenu_1, "\yBuy Menu\w^n^n1. .40 Dual Elites \y($1000)\w^n2. IDF Defender \y($2800)\w^n3. CV-47 \y($3500)\w^n4. M4A1 \y($3500)\w^n^n0. Exit")
}
}
return PLUGIN_CONTINUE

}

public clcmd_say_extra(id)
{
if ( !is_user_alive(id) )
return PLUGIN_HANDLED

static ARGS[15]
read_args(ARGS,14)

remove_quotes(ARGS)

if(equali(ARGS,"/ags"))
{
admin_guns(id)
}
else if (equali(ARGS,"/welcome"))
{
welcome_msg(id)
}
return PLUGIN_CONTINUE
}

public info(id)
{
new help_title[64], len
static msg[2047]
format(help_title,63,"%L",id,"HELP_HEADER")
len = format(msg,2046,"<body bgcolor=#f5f5f5><font color=#000000><br>")
len += format(msg[len],2046-len,"<center><h2>%L</h2><br><table><tr><td><p><b><font color=#000000>",id,"HELP_TITLE")
len += format(msg[len],2046-len,"<h2>%L</h2>",id,"HELP_OBJECTIVE")
len += format(msg[len],2046-len,"%L<br>",id,"HELP_INFO")
}

public buy_menu(id, key)
{
new money = cs_get_user_money(id)

new dualcost = 1000
new idfcost = 2800
new akcost = 3500
new m4a1cost = 3500


switch (key)
{
case 0:
{
if(money < dualcost)
{
client_print(id, print_center, "%L",id, "BUY_MONEY", dualcost)
}
else
{

cs_set_user_money(id, money - dualcost)
give_item(id,"weapon_elite")
}
}
case 1:
{
if(money < idfcost)
{
client_print(id, print_center, "%L",id, "BUY_MONEY", idfcost)
}
else
{

cs_set_user_money(id, money - idfcost)
give_item(id,"weapon_galil")
}
}
case 2:
{
if(money < akcost)
{
client_print(id, print_center, "%L",id, "BUY_MONEY", akcost)
}
else
{

cs_set_user_money(id, money - akcost)
give_item(id,"weapon_ak47")
}
}
case 3:
{
if(money < m4a1cost)
{
client_print(id, print_center, "%L",id, "BUY_MONEY", m4a1cost)
}
else
{

cs_set_user_money(id, money - m4a1cost)
give_item(id,"weapon_m4a1")
}
}
case 9:

return PLUGIN_HANDLED
}
}
public welcome_msg(id)
{
client_print(0,print_chat,"%L",LANG_PLAYER,"W ELCOME_MSG", VERSION)
client_print(0,print_chat,"%L",LANG_PLAYER,"H ELP_MSG")
}

public admin_guns(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED

if (get_user_flags(id) & ADMIN_KICK)
{

strip_user_weapons(id)
give_item(id,"weapon_deagle")
give_item(id,"weapon_hegrenade")
give_item(id,"weapon_knife")
}
return PLUGIN_HANDLED
}
public logevent_round_start(id)
{
set_task (5.0 , "welcomemsg")
set_task (5.0 , "adminguns")
return PLUGIN_CONTINUE
}
public event_hud_reset(id)
{
set_task(0.2,"event_player_spawn",id)

return PLUGIN_CONTINUE
}
public event_player_spawn(id)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED

set_task(random_float(0.1,0.5), "admin_guns", id)

return PLUGIN_CONTINUE
}


PLZ DO NOT STEAL OR COPY MY PLUGIN
Attached Files
File Type: sma Get Plugin or Get Source (warafare finalx1.sma - 588 views - 7.0 KB)

Last edited by dragonbolt; 04-06-2009 at 16:59. Reason: need to fix the issue with name
dragonbolt is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode