|
Senior Member
|

02-16-2008
, 08:16
Blind Shooting & Spy option
|
#1
|
Blind Shooting
Fast review, when you shoot or stab, your screen will be faded and you really have to shoot only when you are 100% sure in the hit. Fade time is different, depending when it's Primary, Secondary or Knife (weapon). Really fun to put "on" sometimes, people really like it in my server...some are deperatly (Probably wrong spelling) requesting for this mod...put some ppl kind of hate it.
Spy option
You can order intel for 1000$ (Changeable). It means that you can see enemy's HP/AP/Weapon. (Displayed by text message). This is good when you are playing 1o1 and want to know what you are up against. I added this to my own server and people really like it...this won't mess up your ordionary gameplay, just little modification...i recommend it.
All this is made by oRNY for me, i decided to make it public in here, i dont know if this is against the rules, ideas were from me and code is from oRNY, so give +karma to oRNY, if this topic is against the rules, PM me.
Quote:
Originally Posted by oRNY
Blind Shooting:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#define PLUGIN "Blind Shooting"
#define VERSION "1.0"
#define AUTHOR "oRNY"
#define W_NONE 0
#define W_PRIMARY 1
#define W_SECONDARY 2
#define W_KNIFE 3
#define W_GRENADE 4
#define W_BOMB 5
new const blindfor[6]={0,750,200,0,200,200}
new g_on //a cvar pointer
public plugin_init()
{
//Register the plugin
register_plugin(PLUGIN, VERSION, AUTHOR)
//Register the cvar that determines if the plugin is enabled or not
g_on=register_cvar("amx_blind","1")
}
public client_PreThink(id)
{
//Check if the player is alive,not a spectator and thye mod is enabled
if ( !(get_pcvar_num(g_on))||(get_user_team(id)==3)||!(is_user_alive(id)) )
return FMRES_IGNORED
//Get his button
new button=get_user_button(id)
//If he is firing
if ( (button&1) )
{
blind(id,blindfor[ typeof(get_user_weapon(id)) ])
}
return FMRES_HANDLED
}
public blind(id,dur)
{
//Send the blinding message
message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id);
write_short(dur); // duration, ~0 is max
write_short(dur); // hold time, ~0 is max
write_short(1<<12); // flags, no idea wtf 1<<12 is
write_byte(255); // red
write_byte(255); // green
write_byte(255); // blue
write_byte(255); // alpha
message_end();
}
public typeof(wp) //Returns the weapon type of the weapon id recieved
{
switch (wp)
{
//If it's a primary weapon
case CSW_SCOUT,CSW_XM1014,CSW_MAC10,CSW_AUG,CSW_UMP45,CSW_SG550,CSW_GALIL,CSW_FAMAS,CSW_AWP,CSW_MP5NAVY,CSW_M249,CSW_M3,CSW_M4A1,CSW_TMP,CSW_G3SG1,CSW_SG552,CSW_AK47,CSW_P90:
{
return W_PRIMARY
}
//If it's a secondery weapon
case CSW_P228,CSW_ELITE,CSW_FIVESEVEN,CSW_USP,CSW_GLOCK18,CSW_DEAGLE:
{
return W_SECONDARY
}
//If it's a knife
case CSW_KNIFE:
{
return W_KNIFE
}
//If it's a granade
case CSW_HEGRENADE,CSW_SMOKEGRENADE,CSW_FLASHBANG:
{
return W_GRENADE
}
//If it's a bomb
case CSW_C4:
{
return W_BOMB
}
//If it's none of the item's above
default:
{
return W_NONE
}
}
return PLUGIN_HANDLED
}
I've done that you are blinded for 0.75 seconds for using primary weapons and 0.2 for using secondery weapons/granades/bombs.
Spy on enemy:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Spy on enemy"
#define VERSION "1.0"
#define AUTHOR "oRNY"
#define COST 1000
new W_NAMES[31][18] = {"","p228","","Scout","HE Grenade","xm1014","C4","mac10","aug","Smoke Grenade","Elite","Fiveseven","ump45","sg550","Galil","Famas","Usp","Glock18","Awp","Mp5","m249","m3","m4a1","tmp","g3sg1","Flashbang","Desert eagle","sg552","AK47","Knife","p90"}
new g_on //a cvar pointer
public plugin_init()
{
//Register the plugin
register_plugin(PLUGIN, VERSION, AUTHOR)
//Register the cvar that determines if the plugin is enabled or not
g_on=register_cvar("amx_spy","1")
//Register the commands
register_clcmd("say","spy")
register_clcmd("say_team","spy")
}
public spy(id)
{
new player_name[64]
read_argv(1,player_name,63)
//If he didn't give a name or the plugin is disabled
if ( !(get_pcvar_num(g_on))||!(equali("/spy",player_name,4)) )
return PLUGIN_HANDLED
//Adjust the message
set_hudmessage(255, 0, 0, -1.0, 0.1)
//Check if there is such a player
new data[2][64]
ExplodeString(data,2,63,player_name,' ')
player_name=data[1]
new player_id=get_user_index(player_name)
if ( (player_id<1) )
{
//Inform the user
show_hudmessage(id,"Player ^"%s^" was not found (this is case-sensitive)",player_name)
//Exit the function
return PLUGIN_HANDLED
}
//Get the other players details
new player_armor=get_user_armor(player_id)
new player_health=get_user_health(player_id)
new player_weapon[18]
player_weapon=W_NAMES[ get_user_weapon(player_id) ]
//See if he can afford it
if ( !(cs_get_user_money(id)>=COST) )
{
//Inform the user
show_hudmessage(id,"You cant sfford to spy (%i$)",COST)
//Exit the function
return PLUGIN_HANDLED
}
//Remove the cost from from his money
cs_set_user_money(id,cs_get_user_money(id)-COST,1)
//Show this information to the player who typed "/spy"
show_hudmessage(id,"Spying on %s:^nHealth: %i^nArmor: %i^nWeapon: %s",player_name,player_health,player_armor,player_weapon)
//Exit the function
return PLUGIN_CONTINUE
}
stock ExplodeString(p_szOutput[][], p_nMax, p_nSize, p_szInput[], p_szDelimiter) //Splits a string with the given delimeter
{
new nIdx = 0, l = strlen(p_szInput)
new nLen = (1 + copyc( p_szOutput[nIdx], p_nSize, p_szInput, p_szDelimiter ))
while( (nLen < l) && (++nIdx < p_nMax) )
nLen += (1 + copyc( p_szOutput[nIdx], p_nSize, p_szInput[nLen], p_szDelimiter ))
return
}
|
Last edited by Zenith77; 02-17-2008 at 11:59.
Reason: Do not upload .amxx's
|
|