Raised This Month: $32 Target: $400
 8% 

Few things...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kileedyg
BANNED
Join Date: Dec 2008
Location: Lithuania
Old 05-05-2012 , 12:03   Few things...
Reply With Quote #1

Could you guys remove unaccesary code from this hilarious rip, and bring it to live?

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)

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"00.0)
he_percent[HIDER] = register_cvar("hider_he_percent""0"00.0)
fb[HIDER] = register_cvar("hider_fb""0"00.0)
fb_percent[HIDER] = register_cvar("hider_fb_percent""0"00.0)
sg[HIDER] = register_cvar("hider_sg""0"00.0)
sg_percent[HIDER] = register_cvar("hider_sg_percent""0"00.0)
armor[HIDER] = register_cvar("hider_armor""100"00.0)
if( 
g_bWeaponsGiven ) {
set_task(0.6"taskGiveWeapons"plr TASK_ID_GIVEWEAPONSparam2g_sBlank0)
}
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(plrget_pcvar_num(he[team]), get_pcvar_num(he_percent[team]),"weapon_hegrenade"CSW_HEGRENADE"HE Grenade");
chance(plrget_pcvar_num(fb[team]), get_pcvar_num(fb_percent[team]), "weapon_flashbang"CSW_FLASHBANG"Flashbang");
chance(plrget_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(num0100);
switch( 
num ) {
case 
0: {
cs_set_user_armor(plr0CS_ARMOR_NONE);
}
case 
1..99: {
cs_set_user_armor(plrnumCS_ARMOR_KEVLAR);
}
case 
100: {
cs_set_user_armor(plrnumCS_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;
}*/ 

Last edited by kileedyg; 05-05-2012 at 12:04.
kileedyg is offline
Send a message via Skype™ to kileedyg
Reply



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 21:10.


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