kileedyg |
05-05-2012 08:02 |
Very simple,constructive request
Hello Fellows,
so i need simple thing for hidenseek, i don't want to use exolent's plugin , couse it have lots of things like scrim,alot of checking,much integrated things,code that i don't use for ages and don't want to use weapon chance plugin couse it have lots of code that i don't use, please don't suggest it,would be great if you make plugin sample ,
the plugin should have functions:
for terrorist team only,giving x amount of he,fb,sg with from 0 to 100 percentage of luck (float would be great ), also these are configurable settings:
hiders_he (amount variable from 0 to x)
hiders_he_percent (variable from 0 to 100)
hiders_fb (amount variable from 0 to x)
hiders_fb_percent (variable from 0 to 100)
hiders_sg (amount variable from 0 to x)
hiders_sg_percent (variable from 0 to 100)
also tryed:
PHP Code:
/* All credits goes to Exolent */
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <fakemeta_util>
#define OFFSET_ARMORTYPE 112 #define OFFSET_TEAM 114
enum CsTeams { CS_TEAM_UNASSIGNED = 0, CS_TEAM_T, CS_TEAM_CT, CS_TEAM_SPECTATOR }; new const g_sTeamInfo[CsTeams][] = { "UNASSIGNED", "TERRORIST", "CT", "SPECTATOR" }; new const g_sTeamNames[CsTeams][] = { "Spectator", "Terrorist", "Counter-Terrorist", "Spectator" }; enum (+= 1000) { TASK_ID_STRIPWEAPONS = 1000, TASK_ID_GIVEWEAPONS }; new const g_PlayerTasks[] = { TASK_ID_STRIPWEAPONS, TASK_ID_GIVEWEAPONS } enum CsArmorType { CS_ARMOR_NONE = 0, CS_ARMOR_KEVLAR, CS_ARMOR_VESTHELM };
new CsTeams:g_Team[33]; new he[CsTeams]; new he_percent[CsTeams]; new fb[CsTeams]; new fb_percent[CsTeams]; new sg[CsTeams]; new sg_percent[CsTeams]; new armor[CsTeams]; new param[2];
new const g_sBlank[] = ""; new const CsTeams:HIDER = CS_TEAM_T; new const CsTeams:SEEKER = CS_TEAM_CT;
new bool:g_bWeaponsGiven;
public plugin_init() { he[HIDER] = register_cvar("hider_he", "0", 0, 0.0) he_percent[HIDER] = register_cvar("hider_he_percent", "0", 0, 0.0) fb[HIDER] = register_cvar("hider_fb", "0", 0, 0.0) fb_percent[HIDER] = register_cvar("hider_fb_percent", "0", 0, 0.0) sg[HIDER] = register_cvar("hider_sg", "0", 0, 0.0) sg_percent[HIDER] = register_cvar("hider_sg_percent", "0", 0, 0.0) armor[HIDER] = register_cvar("hider_armor", "100", 0, 0.0) if( g_bWeaponsGiven ) { set_task(0.6, "taskGiveWeapons", plr + TASK_ID_GIVEWEAPONS, param, 2, g_sBlank, 0) } g_msgArmorType = get_user_msgid("ArmorType");
} public taskStripWeapons(plr) { plr -= TASK_ID_STRIPWEAPONS;
fm_strip_user_weapons(plr);
return PLUGIN_CONTINUE; }
public taskGiveWeapons(param[], plr) { plr -= TASK_ID_GIVEWEAPONS; new CsTeams:team = CsTeams:param[0]; if( team != HIDER && team != SEEKER ) { return PLUGIN_CONTINUE; } chance(plr, get_pcvar_num(he[team]), get_pcvar_num(he_percent[team]),"weapon_hegrenade", CSW_HEGRENADE, "HE Grenade"); chance(plr, get_pcvar_num(fb[team]), get_pcvar_num(fb_percent[team]), "weapon_flashbang", CSW_FLASHBANG, "Flashbang"); chance(plr, get_pcvar_num(sg[team]), get_pcvar_num(sg_percent[team]), "weapon_smokegrenade", CSW_SMOKEGRENADE, "Smoke Grenade"); new num = get_pcvar_num(armor[team]); num = clamp(num, 0, 100); switch( num ) { case 0: { cs_set_user_armor(plr, 0, CS_ARMOR_NONE); } case 1..99: { cs_set_user_armor(plr, num, CS_ARMOR_KEVLAR); } case 100: { cs_set_user_armor(plr, num, CS_ARMOR_VESTHELM); } } return PLUGIN_CONTINUE; } /*if( g_bDisableSlash ) { new button = get_uc(ucHandle, UC_Buttons); if( button&IN_ATTACK ) { button &= ~IN_ATTACK; button |= IN_ATTACK2; } set_uc(ucHandle, UC_Buttons, button); return FMRES_SUPERCEDE; }*/
p.s exolent, don't blame on me,your plugin is great ,i just need couple of things from it,ofcourse for idea credits belongs to you
|