Raised This Month: $ Target: $400
 0% 

Blocking Flashlight For Terrorists Only (moved from Support/Help)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Paulster1022
Member
Join Date: Apr 2006
Old 07-10-2007 , 15:09   Blocking Flashlight For Terrorists Only (moved from Support/Help)
Reply With Quote #1

Hello. Im trying to block the flashlight for terrorists but my code does not seem to work....as i hoped it would. The Flashlight is not working for both terrorists and counter terrorists....and something is definetly wrong..that i can not figure out. Also the client_print will not show anything.....the function is not working properly and mp_flashlight is 1.
Code:
register_impulse(100, "cl_cmd")

register_forward(FM_Cmdstart, "cl_cmd")


public cl_cmd(id, handle, seed)
{
  new impulse = get_uc(handle, UC_Impulse)
  if(cs_get_user_team(id) == CS_TEAM_T) && (impulse == 100)
  {
    	client_print(id, print_chat, "[Vampire Mod] Vampires Can Not Use Flashlights.")
  	set_uc(handle, UC_Impulse, 0)
  }
  return FMRES_HANDLED
}
Paulster1022 is offline
Send a message via AIM to Paulster1022
vvg125
AMX Mod X Beta Tester
Join Date: Dec 2006
Location: Queens (Douglaston), New
Old 07-10-2007 , 15:14   Re: Blocking Flashlight For Terrorists Only
Reply With Quote #2

Try changing this plugin to work for Ts only and not CTs:

http://forums.alliedmods.net/showpos...7&postcount=12


Change this:

Code:
  if(cs_get_user_team(player) == CS_TEAM_T)
to:

Code:
  if(cs_get_user_team(player) == CS_TEAM_CT)
I'm only suggesting it because it's already made...
__________________
vvg125 is offline
Send a message via AIM to vvg125 Send a message via MSN to vvg125 Send a message via Yahoo to vvg125
Paulster1022
Member
Join Date: Apr 2006
Old 07-10-2007 , 15:34   Re: Blocking Flashlight For Terrorists Only
Reply With Quote #3

I want the flashlight to work for Ct's only and block the flashlight for T's. This plugin is allowing both t's and ct's to use a flashlight. I just want Ct's with flashlight . I did change it to if(cs_get_user_team(player) == CS_TEAM_CT) but didnt help.
Code:
#include <amxmodx>
#include <engine>
#include <cstrike>
#include <fun>
 
#define PLUGIN "Terrorists are not allowed a flashlight"
#define VERSION "1.0"
#define AUTHOR "Amxmodx community"
 
new bool:can_impulse[32]
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR)
 register_logevent("round_start", 2, "1=Round_Start")
 
}
 
public round_start()
{
 new players[32], num
 get_players(players, num)
 
 new player
 for(new i = 0; i < num; i++)
 {
  player = players[i]
 
  if(cs_get_user_team(player) == CS_TEAM_CT)
  {
   can_impulse[player] = true
  }
 
  else
   return 1;
 }
 return 1;
}
 
public client_impulse(id,impulse)
{
 if(!can_impulse[id] && impulse == 100)
 {
  return 1;
 }
 return 0;
}
Paulster1022 is offline
Send a message via AIM to Paulster1022
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:32.


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