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

[ZE] Call button message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mikado
Senior Member
Join Date: Nov 2012
Location: don't know where :/
Old 06-20-2014 , 07:52   [ZE] Call button message
Reply With Quote #1

Hi,

need a simple plugin, which when someone press the call button on Zombie escape mod (maps) it will show a colored message on chat
for example:

[Zombie Escape] Player Name Press the call Button, Run Fast !!!

But without bug with other buttons, because some maps has more than one button
Mikado is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-20-2014 , 07:54   Re: [ZE] Call button message
Reply With Quote #2

Well, we will need maybe some link to the mod you use. Also, I think this is included in the maps, so it will be hard to detecd exactly the calling button...
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 06-20-2014 , 08:01   Re: [ZE] Call button message
Reply With Quote #3

Quote:
Originally Posted by Flick3rR View Post
Also, I think this is included in the maps, so it will be hard to detecd exactly the calling button...
This makes it even easier since we can look at the Button Name via BSPViewer and then hook that button.
__________________
Kia is offline
Mikado
Senior Member
Join Date: Nov 2012
Location: don't know where :/
Old 06-20-2014 , 09:49   Re: [ZE] Call button message
Reply With Quote #4

Quote:
Originally Posted by Flick3rR View Post
Well, we will need maybe some link to the mod you use. Also, I think this is included in the maps, so it will be hard to detecd exactly the calling button...
I'm running this mod : https://forums.alliedmods.net/showpo...&postcount=674

Quote:
Originally Posted by Flick3rR View Post
Also, I think this is included in the maps
All tested maps don't have :/
Mikado is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 06-20-2014 , 10:13   Re: [ZE] Call button message
Reply With Quote #5

Quote:
Originally Posted by Mikado View Post
All tested maps don't have :/
Example of ze_jurassickpark3_lg:


Just loop through all buttons until you find the one with the target heli using pev.
__________________
Kia is offline
Mikado
Senior Member
Join Date: Nov 2012
Location: don't know where :/
Old 06-20-2014 , 13:51   Re: [ZE] Call button message
Reply With Quote #6

Someone can help to make the plugin ?
Or it's hard like @Flick3rR said
Mikado is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-20-2014 , 13:53   Re: [ZE] Call button message
Reply With Quote #7

I guess @Kia will make it (said it's easy). I don't have the knowledge about methods he mentioned, so I'm curious te see, too.
__________________

Last edited by Flick3rR; 06-20-2014 at 13:53.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
wicked95
Member
Join Date: Dec 2012
Old 06-20-2014 , 14:58   Re: [ZE] Call button message
Reply With Quote #8

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 - 932 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 #9

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 #10

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



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 17:41.


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