Raised This Month: $ Target: $400
 0% 

[REQ] Strip Primary weapon, secondary weapon, grenades.


Post New Thread Reply   
 
Thread Tools Display Modes
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-28-2011 , 15:18   Re: [REQ] Strip Primary weapon, secondary weapon, grenades.
Reply With Quote #11

Assuming you mean switching weapons:
If the stripped weapon is active, it will make the player switch to another weapon.

Ex: I'm have an m4 deployed & a deagle as last used weapon.
If my m4 gets stripped, it makes me switch to my deagle first & then strip the weapon.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-28-2011 , 15:20   Re: [REQ] Strip Primary weapon, secondary weapon, grenades.
Reply With Quote #12

Got it. If I have M4A1 it switches to ex. deagle and then strip m4a1 right?
__________________
Please enter this website everyday: http://forums.alliedmods.net/showthread.php?t=169067
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-28-2011 , 15:48   Re: [REQ] Strip Primary weapon, secondary weapon, grenades.
Reply With Quote #13

Yeah, i think it switches to the last used weapon (same as pressing q), but i'm not sure about that.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 10-28-2011 at 15:48.
drekes is offline
Send a message via MSN to drekes
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-28-2011 , 15:54   Re: [REQ] Strip Primary weapon, secondary weapon, grenades.
Reply With Quote #14

I'll test it right away.
EDIT: No it doesn't work. It just stays striped model.
__________________
Please enter this website everyday: http://forums.alliedmods.net/showthread.php?t=169067

Last edited by Evaldas.Grigas; 10-28-2011 at 16:00.
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-28-2011 , 19:30   Re: [REQ] Strip Primary weapon, secondary weapon, grenades.
Reply With Quote #15

If you leave bSwitchIfActive true (default), it will switch weapon.
Otherwise you'll see no view model at all.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-29-2011 , 03:11   Re: [REQ] Strip Primary weapon, secondary weapon, grenades.
Reply With Quote #16

Oh. I thought that it had to be false.
__________________
Please enter this website everyday: http://forums.alliedmods.net/showthread.php?t=169067

Last edited by Evaldas.Grigas; 10-29-2011 at 03:11.
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
ramioca
Junior Member
Join Date: Nov 2011
Location: Portugal
Old 11-04-2011 , 10:54   Re: [REQ] Strip Primary weapon, secondary weapon, grenades.
Reply With Quote #17

I am newbie in this and so I have a problem...
I wanted to strip all secondary weapons and grenades of user when this user select the option in the menu, but when user select this, server is down!

I basically can't incorporate your inc in my plugin

PHP Code:
case 0: { 
   if (
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
    
HasC4[id] = true;
   else
    
HasC4[id] = false;
 
   
StripWeapons(idSecondary);
   
give_item(id,"weapon_deagle");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"item_assaultsuit");
   
give_item(id,"item_thighpack"); 

ps: sorry my bad english
ramioca is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-04-2011 , 11:22   Re: [REQ] Strip Primary weapon, secondary weapon, grenades.
Reply With Quote #18

Could you post your complete code ?
I don't see anything wrong with that part on first sight.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
ramioca
Junior Member
Join Date: Nov 2011
Location: Portugal
Old 11-04-2011 , 11:35   Re: [REQ] Strip Primary weapon, secondary weapon, grenades.
Reply With Quote #19

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta_util>
#include <fakemeta> 
#include <stripweapons>
static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
new maxplayers
new gmsgSayText
new mpdmkbmhb
new g_menu_active
new round;
new 
bool:HasC4[33]
#define Keysrod (1<<0)|(1<<1)|(1<<2)|(1<<9) // Keys: 1234567890
public plugin_init()
{
 
register_plugin("VIP""1.0""Donoo")
 
mpd register_cvar("money_per_damage","3")
 
mkb register_cvar("money_kill_bonus","200")
 
mhb register_cvar("money_hs_bonus","500")
 
g_menu_active register_cvar("menu_active""1")
 
register_event("Damage","Damage","b")
 
register_event("DeathMsg","death_msg","a")
 
register_menucmd(register_menuid("rod"), Keysrod"Pressedrod")
 
register_clcmd("say /vip","ShowMotd")
 
maxplayers get_maxplayers()
 
gmsgSayText get_user_msgid("SayText")
 
register_clcmd("say""handle_say")
 
register_cvar("amx_contactinfo"CONTACTFCVAR_SERVER)
 
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1
 
register_event("HLTV""event_new_round""a""1=0""2=0"
 
register_event("TextMsg","Event_RoundRestart","a","2&#Game_w")
 
register_event("DeathMsg""hook_death""a""1>0")
 
register_event("Damage""on_damage""b""2!0""3=0""4!0")
}
public 
Damage(id)
{
 new 
weaponhitpointattacker get_user_attacker(id,weapon,hitpoint)
 if(
attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
 if (
get_user_flags(attacker) & ADMIN_LEVEL_H
 {
  new 
money read_data(2) * get_pcvar_num(mpd)
  if(
hitpoint==1money += get_pcvar_num(mhb)
  
cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
 }
}
public 
death_msg()
{
 if(
read_data(1)<=maxplayers && read_data(1) && read_data(1)!=read_data(2)) cs_set_user_money(read_data(1),cs_get_user_money(read_data(1)) + get_pcvar_num(mkb) - 300)
}
 
public 
fwHamPlayerSpawnPost(id

    if(!
is_user_alive(id)) return PLUGIN_HANDLED
 
    if(
get_user_flags(id) & ADMIN_LEVEL_H
    { 
        if(
get_pcvar_num(g_menu_active) && round 2)
  {
   
Showrod(id)
  }
        return 
PLUGIN_CONTINUE
    } 
    return 
PLUGIN_CONTINUE

public 
event_new_round() 
{
 
round++;
 new 
players[32], playerpnum;
 
get_players(playerspnum"a");
 for(new 
0pnumi++)
 {
  
player players[i];
  if(
get_user_flags(player) & ADMIN_LEVEL_H)
  {
  if (!
get_pcvar_num(g_menu_active))
   return 
PLUGIN_CONTINUE
  
if(round 2)
  {
   
Showrod(player);
  }
  }
 }
 return 
PLUGIN_HANDLED
}
public 
Event_RoundRestart(id)
{
 
round=0;
}
 
public 
Showrod(id) {
 
show_menu(idKeysrod"Menu VIP VL:^n\w1. Deagle ^n\w2. Granadas ^n\w3. Deagle e Granadas ^n0. Exit^n", -1"rod"// Display menu
}
public 
Pressedrod(idkey) {
 
/* Menu:
 * Menu VIP VL
 * 1. Deagle
 * 2. Granadas
 * 3. Deagle e Granadas
 * 0. Exit
 */
 
switch (key) {
  case 
0: { 
   if (
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
    
HasC4[id] = true;
   else
    
HasC4[id] = false;
 
   
StripWeapons(idSecondary);
   
give_item(id,"weapon_deagle");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"item_assaultsuit");
   
give_item(id,"item_thighpack");
   
client_print(idprint_center"Recebeste Deagle gratuitamente")
 
   if (
HasC4[id])
   {
    
give_item(id"weapon_c4");
    
cs_set_user_plantid );
   }
   }
  case 
1: { 
   if (
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
    
HasC4[id] = true;
   else
    
HasC4[id] = false;
 
   
StripWeapons(idGrenades);
   
give_item(id,"weapon_hegrenade");
   
give_item(id,"weapon_flashbang");
   
give_item(id,"weapon_flashbang");
   
give_item(id,"weapon_smokegrenade");
   
give_item(id,"item_assaultsuit");
   
give_item(id,"item_thighpack");
   
client_print(idprint_center"Recebeste Granadas gratuitamente")
 
   if (
HasC4[id])
   {
    
give_item(id"weapon_c4");
    
cs_set_user_plantid );
   }
   }
  case 
2: { 
   if (
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
    
HasC4[id] = true;
   else
    
HasC4[id] = false;
 
   
StripWeapons(idSecondary);
   
StripWeapons(idGrenades);
   
give_item(id,"weapon_deagle");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"ammo_50ae");
   
give_item(id,"weapon_hegrenade");
   
give_item(id,"weapon_flashbang");
   
give_item(id,"weapon_flashbang");
   
give_item(id,"weapon_smokegrenade");
   
give_item(id,"item_assaultsuit");
   
give_item(id,"item_thighpack");
   
client_print(idprint_center"Recebeste Deagle e granadas gratuitamente")
 
   if (
HasC4[id])
   {
    
give_item(id"weapon_c4");
    
cs_set_user_plantid );
   }
   }
  case 
9: {    
  }
 }
 return 
PLUGIN_CONTINUE
}
public 
ShowMotd(id)
{
 
show_motd(id"vip.txt")
}
public 
client_authorized(id)
{
 
set_task(30.0"PrintText" ,id)
}
public 
PrintText(id)
{
 
client_print(idprint_chat"[VL] Escreve /vip e descobre os seus previlegios.")
}
public 
handle_say(id) {
 new 
said[192]
 
read_args(said,192)
 if( ( 
containi(said"who") != -&& containi(said"admin") != -) || contain(said"/vips") != -)
  
set_task(0.1,"print_adminlist",id)
 return 
PLUGIN_CONTINUE
}
public 
print_adminlist(user
{
 new 
adminnames[33][32]
 new 
message[256]
 new 
contactinfo[256], contact[112]
 new 
idcountxlen
 
 
for(id id <= maxplayers id++)
  if(
is_user_connected(id))
   if(
get_user_flags(id) & ADMIN_LEVEL_H)
    
get_user_name(idadminnames[count++], 31)
 
len format(message255"%s VIP ONLINE: ",COLOR)
 if(
count 0) {
  for(
count x++) {
   
len += format(message[len], 255-len"%s%s "adminnames[x], < (count-1) ? ", ":"")
   if(
len 96 ) {
    
print_message(usermessage)
    
len format(message255"%s ",COLOR)
   }
  }
  
print_message(usermessage)
 }
 else {
  
len += format(message[len], 255-len"No VIP online.")
  
print_message(usermessage)
 }
 
 
get_cvar_string("amx_contactinfo"contact63)
 if(
contact[0])  {
  
format(contactinfo111"%s Contact Server Admin -- %s"COLORcontact)
  
print_message(usercontactinfo)
 }
}
print_message(idmsg[]) {
 
message_begin(MSG_ONEgmsgSayText, {0,0,0}, id)
 
write_byte(id)
 
write_string(msg)
 
message_end()

the plugin is edited but i need this menu for server because the original plugin is unfair in my opinion

edit: And if you can,I like that you teach me to do disappear the menu in 15 seconds

Last edited by ramioca; 11-04-2011 at 12:17.
ramioca is offline
Vebster
Junior Member
Join Date: Sep 2011
Old 11-04-2011 , 15:23   Re: [REQ] Strip Primary weapon, secondary weapon, grenades.
Reply With Quote #20

I have the same problem, as ramioca. It crashes the server, on the next round start, but I have a different VIP plugin.

Last edited by Vebster; 11-04-2011 at 15:23.
Vebster 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 13:01.


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