Raised This Month: $51 Target: $400
 12% 

[Req] Player say = slap 50 dmg.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 01-07-2008 , 01:49   [Req] Player say = slap 50 dmg.
Reply With Quote #1

hi
Can anyone make a plug if player use command say the player is slapped with 50 of damage? thanks.

don't ask me why y request this, i needed no more :F
if it's possible do it with a cvar
__________________

Last edited by IneedHelp; 01-07-2008 at 05:33.
IneedHelp is offline
chris-1337
Senior Member
Join Date: Jan 2008
Location: The United Kingdom Of Gr
Old 01-07-2008 , 12:14   Re: [Req] Player say = slap 50 dmg.
Reply With Quote #2

I think this should work:

Code:
#include <amxmodx>
public plugin_init()
{
  register_plugin("Slap Say", "1.00", "chris-1337");
  register_clcmd("say", "slap_say", 0, "- slap user for 50 damage.");
}
public slap_say(id)
{
  user_slap(id, 50);
}
chris-1337 is offline
Send a message via MSN to chris-1337
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 01-07-2008 , 13:25   Re: [Req] Player say = slap 50 dmg.
Reply With Quote #3

hey chris, i have a idea..

u can add cvars to can change the command, for example when a player use the commands: "kill", "sensitivity".. or somethings like this, the player is slapped, or other punishments..

whit cvar is good, but whit a .cfg or .ini is excelente
Alucard^ is offline
Send a message via Skype™ to Alucard^
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 01-07-2008 , 20:01   Re: [Req] Player say = slap 50 dmg.
Reply With Quote #4

I want it too..
That plugin is right but i need a cvar like..

If amx_nosay "1" the plugin is on
If amx_nosay "0" the plugin off

Too i need the plugin slap only people with "z" flag , if the user have the "b" flag can't be slapped.


And the idea of alucard is awesome, if the user try to change the client side cvar like sensitivity get slapped with 50 dmg , and can send a message to admines like "the player %s was trying to change the cvar [cvar] to %s | cvar changed default (%s)"
__________________

Last edited by IneedHelp; 01-07-2008 at 20:35.
IneedHelp is offline
chris-1337
Senior Member
Join Date: Jan 2008
Location: The United Kingdom Of Gr
Old 01-08-2008 , 12:44   Re: [Req] Player say = slap 50 dmg.
Reply With Quote #5

This is slap for 50 damage if a client uses "say" command & doesn't have access level "b" for admin (ADMIN_RESERVATION):
Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
  register_plugin("Slap Say", "1.00", "chris-1337");
  register_clcmd("say", "slap_say", 0, "- slap user for 50 damage.");
  register_concmd("amx_nosay", "cmd_nosay", ADMIN_RESERVATION, "- change the no say cvar");
  register_cvar("amx_cvar_nosay", "0");
}
public cmd_nosay(id, level, cid)
{
  if(cmd_access(id, level, cid, 0))
  {
    if(read_argc() == 1)
    {
      console_print(id,"^"amx_cvar_nosay^" is ^"%d^"", get_cvar_num("amx_cvar_nosay"));
    }
    else
    {
      new arg1[2];
      read_argv(1, arg1, 1);
      set_cvar_num("amx_cvar_nosay", str_to_num(arg1));
    }
  }
  return PLUGIN_HANDLED;
}
public slap_say(id, level)
{
  if(get_cvar_num("amx_cvar_nosay") == 1)
  {
    if(!access(id, ADMIN_RESERVATION))
    {
      user_slap(id, 50);
    }
  }
  new clientsay[129], name[33];
  read_args(clientsay, 128);
  remove_quotes(clientsay);
  get_user_name(id, name, 32);
  client_print(0, print_chat, "%s: %s", name, clientsay);
  return PLUGIN_HANDLED;
}
The command "amx_nosay", if no parameters are supplied then it will tell you the value of "amx_cvar_nosay", or if parameters are supplied then it will change the value of "amx_cvar_nosay"
Just as a note, as I have overwrited the "say" command & am not sure how to add colour to the print, the names are the same colour as the text when people say.

Which client cvars would you like to have punishments for & I will see what I can do =)

Last edited by chris-1337; 01-08-2008 at 12:50. Reason: extra information
chris-1337 is offline
Send a message via MSN to chris-1337
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 01-08-2008 , 18:25   Re: [Req] Player say = slap 50 dmg.
Reply With Quote #6

Hey
The plugin works great!

Can you optimize de code a little bit¿?
And i want this too..

1)I think, if the team of the user is SPECT,CT,or T, and have the Reservation flag can't be slapped.
2)I don't understand much the concmd.. i think you can do with pcvar or cvar no more..because is very simple!!!

the other is good
thanks if you can do it +karma
if i can

EDIT:
1)
PHP Code:
if ((cs_get_user_team(id) == CS_TEAM_SPECTATOR) || (cs_get_user_team(id) == CS_TEAM_CT) || (cs_get_user_team(id) == CS_TEAM_T) ||  (get_user_flags(id) & ADMIN_RESERVATION))
return 
PLUGIN_HANDLED
2)
PHP Code:
if((get_pcvar_num(pcvar) == 1)
return 
PLUGIN_CONTINUE;
user_slap(id50
do you understand my idea? thx
__________________

Last edited by IneedHelp; 01-08-2008 at 19:27.
IneedHelp is offline
chris-1337
Senior Member
Join Date: Jan 2008
Location: The United Kingdom Of Gr
Old 01-09-2008 , 13:06   Re: [Req] Player say = slap 50 dmg.
Reply With Quote #7

Quote:
1)I think, if the team of the user is SPECT,CT,or T, and have the Reservation flag can't be slapped.
2)I don't understand much the concmd.. i think you can do with pcvar or cvar no more..because is very simple!!!
Okay then, if I actually understand "1)" then it already does this.
For "2)" when I test this, I cannot change the variable for nosay using "amx_nosay", so I made the function to either give you it's value or change it.

Here it is (the old code wasn't great...) this is better:
Code:
#include <amxmodx>
#include <amxmisc>
new say_slap;
public plugin_init()
{
  register_plugin("Slap Say", "1.00", "chris-1337");
  register_clcmd("say", "slap_say", 0, "- slap user for 50 damage.");
  register_concmd("amx_nosay", "cmd_nosay", ADMIN_RESERVATION, "- change the no say cvar");
  say_slap=register_cvar("amx_cvar_nosay", "0");
}
public cmd_nosay(id, level, cid)
{
  if(cmd_access(id, level, cid, 0))
  {
    if(read_argc() == 1)
    {
      console_print(id,"^"amx_cvar_nosay^" is ^"%d^"", get_pcvar_num(say_slap));
    }
    else
    {
      new arg1[2];
      read_argv(1, arg1, 1);
      set_pcvar_num(say_slap, str_to_num(arg1));
    }
  }
  return PLUGIN_HANDLED;
}
public slap_say(id, level)
{
  if(get_pcvar_num(say_slap) && !access(id, ADMIN_RESERVATION))
  {
    user_slap(id, 50);
  }
  return PLUGIN_CONTINUE;
}
Anything else?

Last edited by chris-1337; 01-09-2008 at 13:07. Reason: additional sentence
chris-1337 is offline
Send a message via MSN to chris-1337
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 04:41.


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