|
楼主 |
发表于 2012-5-20 16:31:50
|
显示全部楼层
来自 中国–山东
忘了 里面 源码了 唉 补偿
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#define PLUGIN "WarmUP Pro"
#define VERSION "3.1"
#define AUTHOR "ReymonARG"
#define time_delay 1
#define ITEM_HE (1<<0) // "a"
#define ITEM_FS (1<<1) // "b"
#define ITEM_SG (1<<2) // "c"
#define ITEM_C4 (1<<3) // "d"
#define HIDE_MONEY (1<<5) // Disable Hud off Money
#define SHOW_MONEY (1<<7) // Enable Hud off Money
new num_time, sync, time_s, activadoo, respawn3d, itemsxd, RGB, cvar_x, cvar_y, mode, timeprotect
new bool:g_is_dead[33];
new bool:g_can_respawn;
new bool:g_cuchi;
new bool:g_items;
new bool:wup_on;
new bool:g_is_connect[33];
new g_iMsg_HideWeapon
#define FLAG_ALIVE (1<<0)
#define FLAG_DEAD (1<<1)
#define FLAG_DISCONNECT (1<<2)
#define FLAG_T (1<<0)
#define FLAG_CT (1<<1)
// custom indexes
#define DEFUSER 0
#define SHIELD 2
#define CONTAIN_FLAG_OF_INDEX(%1,%2) ((%1) & (1<<(%2)))
new const g_wbox_class[] = "weaponbox"
new const g_shield_class[] = "weapon_shield"
new const g_wbox_model[] = "models/w_weaponbox.mdl"
new const g_model_prefix[] = "models/w_"
new g_max_clients
new g_max_entities
new g_pcvar_allow
#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))
stock fm_strip_user_weapons(index) {
new ent = fm_create_entity("player_weaponstrip")
if (!pev_valid(ent))
return 0
dllfunc(DLLFunc_Spawn, ent)
dllfunc(DLLFunc_Use, ent, index)
engfunc(EngFunc_RemoveEntity, ent)
return 1
}
stock fm_give_item(index, const item[]) {
if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
return 0
new ent = fm_create_entity(item)
if (!pev_valid(ent))
return 0
new Float:origin[3]
pev(index, pev_origin, origin)
set_pev(ent, pev_origin, origin)
set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
dllfunc(DLLFunc_Spawn, ent)
new save = pev(ent, pev_solid)
dllfunc(DLLFunc_Touch, ent, index)
if (pev(ent, pev_solid) != save)
return ent
engfunc(EngFunc_RemoveEntity, ent)
return -1
}
new const g_weapon_names[][] =
{
"", // Null random 1 to X This is 0
"weapon_p228",
"weapon_scout",
"weapon_xm1014",
"weapon_mac10",
"weapon_aug",
"weapon_elite",
"weapon_fiveseven",
"weapon_ump45",
"weapon_sg550",
"weapon_galil",
"weapon_famas",
"weapon_usp",
"weapon_glock18",
"weapon_awp",
"weapon_mp5navy",
"weapon_m249",
"weapon_m3",
"weapon_m4a1",
"weapon_tmp",
"weapon_g3sg1",
"weapon_deagle",
"weapon_sg552",
"weapon_ak47",
"weapon_p90"
};
#define MAX_WEAPONS sizeof(g_weapon_names)
new const g_weapon_ammo[MAX_WEAPONS][] =
{
"", // Null random 1 to X This is 0
"ammo_357sig",
"ammo_762nato",
"ammo_buckshot",
"ammo_45acp",
"ammo_556nato",
"ammo_9mm",
"ammo_57mm",
"ammo_45acp",
"ammo_556nato",
"ammo_556nato",
"ammo_556nato",
"ammo_45acp",
"ammo_9mm",
"ammo_338magnum",
"ammo_9mm",
"ammo_556natobox",
"ammo_buckshot",
"ammo_556nato",
"ammo_9mm",
"ammo_762nato",
"ammo_50ae",
"ammo_556nato",
"ammo_762nato",
"ammo_57mm"
};
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("wup_version", VERSION,FCVAR_SERVER)
register_cvar("wup_author", AUTHOR,FCVAR_SERVER)
register_event("TextMsg","autostartrr","a","2&#Game_C");
RegisterHam(Ham_Killed, "player", "FwdPlayerDeath", 1);
RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1);
register_event("CurWeapon", "check_change", "be", "1=1");
register_forward(FM_SetModel, "forward_set_model")
g_pcvar_allow = register_cvar("wup_drop", "")
g_max_clients = global_get(glb_maxClients)
g_max_entities = global_get(glb_maxEntities)
sync = CreateHudSyncObj();
register_dictionary( "warmuppro.txt" );
register_concmd("wup_disable","admin_exec1",ADMIN_BAN,"Stop the WarmUP")
register_concmd("wup_enable","admin_exec2",ADMIN_BAN,"Start a new WarmUP")
g_iMsg_HideWeapon = get_user_msgid( "HideWeapon" );
activadoo = register_cvar("wup_autostart", "1")
respawn3d = register_cvar("wup_respawn", "1")
itemsxd = register_cvar("wup_items", "abcd")
mode = register_cvar("wup_mode", "1")
num_time = register_cvar("wup_time","120")
RGB = register_cvar("wup_color", "255255255")
cvar_x = register_cvar("wup_setx", "-1.0")
cvar_y = register_cvar("wup_sety", "0.28")
timeprotect = register_cvar("wup_protecttime", "3")
set_task(0.1, "escribircvars")
}
public escribircvars()
{
new filename[64]
get_configsdir(filename, 63);
add(filename, 63, "/warmuppro.cfg");
if(file_exists(filename))
server_cmd("exec ^"%s^"",filename)
else
{
write_file(filename,";/////////WARMUP PRO FILE\\\\\\\\\\;")
write_file(filename,";/////////WARMUP PRO FILE\\\\\\\\\\;")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";Enable the WarmUP when the GameStart")
write_file(filename,"wup_autostart 1")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";Enable the respawn is a player die in the WarmUP")
write_file(filename,"wup_respawn 1")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";Items to give to a player in the respawn")
write_file(filename,";A) Give HE B) Give FB C) Give SG")
write_file(filename,";D) Give C4 to Terrorist And Defuse to CT.")
write_file(filename,"wup_items ^"abcd^"")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";0) Normal Rounds 1) Weapon Chance 2) Knife")
write_file(filename,"wup_mode 1")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";Set the during of the warmUP.")
write_file(filename,"wup_time 120")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";Color of the Hud that show time remending.")
write_file(filename,"wup_color ^"255255255^"")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";X Position of the hud")
write_file(filename,"wup_setx ^"-1.0^"")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";Y Position of the hud")
write_file(filename,"wup_sety ^"0.28^"")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";Set Time of SpawnProtection 0 = Disable")
write_file(filename,"wup_protectime 3")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";This plis dont change :D ")
write_file(filename,"wup_drop ^"^" // This Dont change")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";")
write_file(filename,";/////////WARMUP PRO FILE\\\\\\\\\\;")
write_file(filename,";/////////WARMUP PRO FILE\\\\\\\\\\;")
write_file(filename,"echo WarmUP Pro Cvars Enable.")
write_file(filename,"echo WarmUP Pro Create by ReymonARG")
write_file(filename,";/////////WARMUP PRO FILE\\\\\\\\\\;")
write_file(filename,";/////////WARMUP PRO FILE\\\\\\\\\\;")
server_cmd("exec %s",filename)
}
}
public get_item_flags()
{
new sFlags[24]
get_pcvar_string(itemsxd,sFlags,23)
return read_flags(sFlags)
}
|
|