Raised This Month: $ Target: $400
 0% 

[ZE] Call button message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wicked95
Member
Join Date: Dec 2012
Old 06-20-2014 , 14:58   Re: [ZE] Call button message
Reply With Quote #1

Not tested but this may work for you:

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
public plugin_init()
{
 
register_plugin("ZE Show Button Used""1.0""Wicked-");
 
RegisterHam(Ham_Use"func_button""fwButtonUsed");
 new 
ent = -1target[6];
 while((
ent engfunc(EngFunc_FindEntityByString,ent ,"classname""func_button")) != 0)
 {
  
pev(entpev_targetnametarget5);
  if(
target[0] == 'h' && target[1] == 'e' && target[2] == 'l' && target[3] == 'i')
   return 
set_fail_state("[ZE Show Button Used] Zombie Escape Button not found.");
 }
 return 
PLUGIN_CONTINUE;
}
public 
fwButtonUsed(entid)
{
 new 
target[6];
 
pev(entpev_targetnametarget5);
 if(
target[0] == 'h' && target[1] == 'e' && target[2] == 'l' && target[3] == 'i')
 {
  new 
name[32];
  
get_user_name(idname31);
  
client_print(0print_chat"[ZE] '%s' used the escape button."name);
 }

If someone can test it and it works post a reply pls
Attached Files
File Type: sma Get Plugin or Get Source (ze_show_button_used.sma - 945 views - 876 Bytes)

Last edited by wicked95; 06-20-2014 at 14:59.
wicked95 is offline
ArabicMan
Veteran Member
Join Date: Feb 2014
Location: مصر
Old 06-20-2014 , 15:57   Re: [ZE] Call button message
Reply With Quote #2

Quote:
Originally Posted by wicked95 View Post
Not tested but this may work for you:

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
public plugin_init()
{
 
register_plugin("ZE Show Button Used""1.0""Wicked-");
 
RegisterHam(Ham_Use"func_button""fwButtonUsed");
 new 
ent = -1target[6];
 while((
ent engfunc(EngFunc_FindEntityByString,ent ,"classname""func_button")) != 0)
 {
  
pev(entpev_targetnametarget5);
  if(
target[0] == 'h' && target[1] == 'e' && target[2] == 'l' && target[3] == 'i')
   return 
set_fail_state("[ZE Show Button Used] Zombie Escape Button not found.");
 }
 return 
PLUGIN_CONTINUE;
}
public 
fwButtonUsed(entid)
{
 new 
target[6];
 
pev(entpev_targetnametarget5);
 if(
target[0] == 'h' && target[1] == 'e' && target[2] == 'l' && target[3] == 'i')
 {
  new 
name[32];
  
get_user_name(idname31);
  
client_print(0print_chat"[ZE] '%s' used the escape button."name);
 }

If someone can test it and it works post a reply pls
Tested not work.
ArabicMan is offline
bat
Veteran Member
Join Date: Jul 2012
Old 06-20-2014 , 15:59   Re: [ZE] Call button message
Reply With Quote #3

Quote:
Originally Posted by ArabicMan View Post
Tested not work.
I don't know you like it?

Code:
#include <amxmodx>
#include <hamsandwich>
 
new Float:g_flReUseButtonTime;
 
public plugin_init()
{
        RegisterHam(Ham_Use, "func_button", "FwdUseButtonPost", 1)
}
 
public FwdUseButtonPost(ent, caller, activator)
{
        if(get_user_team(activator) != 2)
                return;
 
        if(g_flReUseButtonTime + 3.0 > get_gametime())
                return;
 
        g_flReUseButtonTime = get_gametime();
 
        new szName[32], szMsg[192];
        get_user_name(activator, szName, charsmax(szName))
        formatex(szMsg, charsmax(szMsg), "^x04[ZE] ^x01Player ^x04%s ^x01press a button!", szName)
 
        for(new i = 0; i <= get_maxplayers(); i++)
        {
                if(!is_user_connected(i))
                        continue;
 
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, i)
                write_byte(i)
                write_string(szMsg)
                message_end()
        }
}
bat is offline
Send a message via Skype™ to bat
Reply


Thread Tools
Display Modes

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 18:05.


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