AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [ZE] Call button message (https://forums.alliedmods.net/showthread.php?t=242483)

Mikado 06-20-2014 07:52

[ZE] Call button message
 
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 :)

Flick3rR 06-20-2014 07:54

Re: [ZE] Call button message
 
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...

Kia 06-20-2014 08:01

Re: [ZE] Call button message
 
Quote:

Originally Posted by Flick3rR (Post 2154522)
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.

Mikado 06-20-2014 09:49

Re: [ZE] Call button message
 
Quote:

Originally Posted by Flick3rR (Post 2154522)
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 (Post 2154522)
Also, I think this is included in the maps

All tested maps don't have :/

Kia 06-20-2014 10:13

Re: [ZE] Call button message
 
Quote:

Originally Posted by Mikado (Post 2154567)
All tested maps don't have :/

Example of ze_jurassickpark3_lg:
http://puu.sh/9C8eg/7152f545b6.jpg

Just loop through all buttons until you find the one with the target heli using pev.

Mikado 06-20-2014 13:51

Re: [ZE] Call button message
 
Someone can help to make the plugin ?
Or it's hard like @Flick3rR said :(

Flick3rR 06-20-2014 13:53

Re: [ZE] Call button message
 
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.

wicked95 06-20-2014 14:58

Re: [ZE] Call button message
 
1 Attachment(s)
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 :D

ArabicMan 06-20-2014 15:57

Re: [ZE] Call button message
 
Quote:

Originally Posted by wicked95 (Post 2154710)
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 :D

Tested not work.

bat 06-20-2014 15:59

Re: [ZE] Call button message
 
Quote:

Originally Posted by ArabicMan (Post 2154749)
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()
        }
}



All times are GMT -4. The time now is 18:05.

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