Raised This Month: $ Target: $400
 0% 

One shot in fiveseven and some other stuff : hNs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nimro0d
Junior Member
Join Date: Oct 2007
Old 12-22-2007 , 14:32   One shot in fiveseven and some other stuff : hNs
Reply With Quote #1

Okey i know this has been covered a lots of times, but dont post like " Use the search button " If u can find it make a link for me! :Z
I need help getting 1/0 shots on fiveseven.
please answer, if u know.
And i will also like to know how to make ct not allowed to use slash but if they lose 3 rounds they are allowed. thanks
nimro0d is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 12-22-2007 , 14:37   Re: One shot in fiveseven and some other stuff : hNs
Reply With Quote #2

1.Give player the weapon fiveseven then, use cs_set_weapon_ammo(*Weapon Ent index, Newammo).
2. Here
Code:
#include <amxmodx>
#include <fakemeta>
 
#define PLUGIN "Hide N Seek Extra"
#define VERSION "1.0"
#define AUTHOR "Alka"
 
new ct_wins = 3;
new bool:allow_nubslash;
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
 
 register_forward(FM_PlayerPreThink,"Fwd_PlayerPreThink");
 
 register_event("SendAudio", "Terrorists_Win", "a", "2&%!MRAD_terwin");
 register_event("SendAudio", "CT_Win", "a", "2&%!MRAD_ctwin");
 
 register_logevent("round_start", 2, "1=Round_Start")
}
 
public Terrorists_Win()
 ct_wins--;
 
public CT_Win()
{
 ct_wins = 3;
 allow_nubslash = false;
}
 
public round_start()
{
 if(ct_wins <= 0)
 {
  allow_nubslash = true;
  
  client_print(0, print_chat, "=================================================");
  client_print(0, print_chat, "CT's have lost 3 rounds in a row. They are allowed to use the Nubslash!");
  client_print(0, print_chat, "=================================================");
 }
}
 
public Fwd_PlayerPreThink(id)
{
 static temp, weapon;
 weapon = get_user_weapon(id, temp, temp);
 
 if(weapon == CSW_KNIFE && get_user_team(id) == 2)
 {
  static button;
  button = pev(id, pev_button);
  
  if(button & IN_ATTACK && allow_nubslash)
  {
   button = (button & IN_ATTACK);
   set_pev(id, pev_button, button);
  }
  
  else if(button & IN_ATTACK && !allow_nubslash)
  {
   button = (button & ~IN_ATTACK ) | IN_ATTACK2;
   set_pev(id, pev_button, button);
  }
 }
}
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
nimro0d
Junior Member
Join Date: Oct 2007
Old 12-22-2007 , 15:47   Re: One shot in fiveseven and some other stuff : hNs
Reply With Quote #3

Thanks Alka, may you please help me script the one shot in the fiveseven.^^
I cant script... :Z
+karma

Last edited by nimro0d; 12-22-2007 at 16:06.
nimro0d is offline
nimro0d
Junior Member
Join Date: Oct 2007
Old 12-22-2007 , 17:32   Re: One shot in fiveseven and some other stuff : hNs
Reply With Quote #4

Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define Plugin "Weapon Chance"
#define Version "1.0"
#define Author "Doombringer"

#define TIME_TO_WAIT 5.0

public plugin_init()
{
register_plugin(Plugin, Version, Author)
register_logevent("round_start", 2, "1=Round_Start")
}

public main_func()
{
new players[32], num
get_players(players, num)

new player
for(new i = 0; i < num; i++)
{
player = players[i]

if(random_num(0, 100) <= 5)
{ 
give_item(player, "weapon_awp")

cs_set_user_bpammo(player, CSW_AWP, 1)
client_print(player, print_chat, "You were lucky, you got a AWP with 1 bullet (5% chance)")
}

if(random_num(0, 100) <= 10)
{
give_item(player, "weapon_fiveseven") 

cs_set_user_bpammo(player, CSW_FIVESEVEN, 2)
client_print(player, print_chat, "You were lucky, you got a five seven with 2 bullets (10% chance)")
}

if(random_num(0, 100) <= 15)
{
give_item(player, "weapon_hegrenade")
client_print(player, print_chat, "You were lucky, you got a hegrenade (15% chance)")
}


}
}

public round_start()
{
set_task(TIME_TO_WAIT, "main_func")
Where shall i put it in this script?
nimro0d is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 12-22-2007 , 17:52   Re: One shot in fiveseven and some other stuff : hNs
Reply With Quote #5

Stop PM-ing me if you posted here...
Here:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
 
#define Plugin "Weapon Chance"
#define Version "1.0"
#define Author "Doombringer"
 
#define TIME_TO_WAIT 3.0
 
public plugin_init()
{
 register_plugin(Plugin, Version, Author);
 register_event("HLTV", "_new_round", "a", "1=0", "2=0");
}
 
public _give_func()
{
 new players[32], num, player;
 get_players(players, num);
 
 for(new i = 0; i < num; i++)
 {
  player = players[i];
  
  if(random_num(0, 100) <= 5)
  { 
   give_item(player, "weapon_awp");
   
   cs_set_weapon_ammo(fm_get_weapon_id(player, "weapon_awp"), 1);
   client_print(player, print_chat, "You were lucky, you got a AWP with 1 bullet (5%% chance)");
  }
  
  if(random_num(0, 100) <= 10)
  {
   give_item(player, "weapon_fiveseven");
   
   cs_set_weapon_ammo(fm_get_weapon_id(player, "weapon_fiveseven"), 1);
   client_print(player, print_chat, "You were lucky, you got a five seven with 1 bullet (10%% chance)");
  }
  
  if(random_num(0, 100) <= 15)
  {
   give_item(player, "weapon_hegrenade");
   client_print(player, print_chat, "You were lucky, you got a hegrenade (15%% chance)");
  }
 }
}
 
public _new_round()
 set_task(TIME_TO_WAIT, "_give_func");
 
stock fm_get_weapon_id(index, const weapon[])
{
 new ent = -1;
 
 while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", weapon)) != 0)
 {
  if(index == pev(ent, pev_owner))
   return ent;
 }
 return 0;
}
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
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 11:12.


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