Raised This Month: $32 Target: $400
 8% 

[Plugin Idea] Entity Message Editor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snake.
Senior Member
Join Date: Jul 2017
Old 06-13-2020 , 10:26   [Plugin Idea] Entity Message Editor
Reply With Quote #1

When we aim on a entity and press use, we will be able to name it with messagemode. Those messages will appear if players use it. (breaking breakables, pressing buttons etc...)
Messages should include player name with %name command.

For example i named a breakable wooden bridge and made its message like this: $name broke a wooden bridge!
Would also be cool to make messages colored: ^3%name ^1broke a ^4wooden bridge!

This plugin is useful specially for zombie escape server where its forbidden to break bridges while player standing on it. I know there's already a plugin like this but it's limited that only shows %name broke something, not special message per entity.
Snake. is offline
Send a message via Skype™ to Snake.
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-13-2020 , 15:08   Re: [Plugin Idea] Entity Message Editor
Reply With Quote #2

Quote:
Originally Posted by Snake. View Post
When we aim on a entity and press use, we will be able to name it with messagemode. Those messages will appear if players use it. (breaking breakables, pressing buttons etc...)
Messages should include player name with %name command.

For example i named a breakable wooden bridge and made its message like this: $name broke a wooden bridge!
Would also be cool to make messages colored: ^3%name ^1broke a ^4wooden bridge!

This plugin is useful specially for zombie escape server where its forbidden to break bridges while player standing on it. I know there's already a plugin like this but it's limited that only shows %name broke something, not special message per entity.
Enjoy
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
public plugin_init()
{
    
register_plugin("[ZE] Kirici Gosterim","1.0","Multipower")
    
    
RegisterHam(Ham_TakeDamage,"func_breakable","Kirildi",1)
}

public 
Kirildi(entweaponkiller)
{
    if(
entity_get_float(ent,EV_FL_health)<0)
    {
        static 
name32 ];
        
get_user_namekillernamecharsmaxname ) );
        
renkli_yazi(0,"!g[ZE] !y%s !thas broken something.",name)
        
renkli_yazi(0,"!g[ZE] !y%s !tbirseyler kirdi.",name)
        return(
HAM_IGNORED);
    }
    return(
HAM_IGNORED);
}

stock renkli_yazi( const id, const input[], any: ... )
{
    new 
count 1players[32], iplayer;
    static 
msg[191];
    if ( 
numargs() == )
        
copymsg190input );
    else
        
vformatmsg190input);
    
replace_allmsg190"!g""^4" );
    
replace_allmsg190"!y""^1" );
    
replace_allmsg190"!t""^3" );
    if ( 
id )
    {
        if ( !
is_user_connectedid ) ) return;
        
players[0] = id;
    } else 
get_playersplayerscount"ch" );
    for ( 
0counti++ )
    {
        
player players[i];
        
message_beginMSG_ONE_UNRELIABLEget_user_msgid"SayText" ), _player );
        
write_byteplayer );
        
write_stringmsg );
        
message_end();
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/ 
Supremache is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 06-14-2020 , 08:48   Re: [Plugin Idea] Entity Message Editor
Reply With Quote #3

@Supremache
read his post again

This plugin is useful specially for zombie escape server where its forbidden to break bridges while player standing on it. I know there's already a plugin like this but it's limited that only shows %name broke something, not special message per entity.
ZaX is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-15-2020 , 23:34   Re: [Plugin Idea] Entity Message Editor
Reply With Quote #4

Quote:
Originally Posted by ZaX View Post
@Supremache
read his post again

This plugin is useful specially for zombie escape server where its forbidden to break bridges while player standing on it. I know there's already a plugin like this but it's limited that only shows %name broke something, not special message per entity.
Idk what do you mean, but i think you want plugin that show who's broke something in public chat

Try this one.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <cromchat>

new const szPrefix[] = { "&x01[&x04ZE&x01]" };

public 
plugin_init()
{
     
register_plugin("Breakable","1.1","MrAbdoO")
     
RegisterHam(Ham_TakeDamage,"func_breakable","FwdHamBreakableKilled",1)
}

public 
FwdHamBreakableKilled(entweaponkiller)
{
    if(
entity_get_float(ent,EV_FL_health)<0)
    {
        static 
szName32 ];
        
get_user_namekillerszNamecharsmaxszName ) );
        
CC_SendMessage(0,"%s Player &x05%s&x01 has broken Something."szPrefixszName)
        
set_hudmessage(random(255), random(255), random(255), -1.00.1710.05.01.01.0, -1)
        
show_hudmessage(0"Player %s has broken Something"szName)
        return(
HAM_IGNORED);
    }
    return(
HAM_IGNORED);


Supremache is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 06-16-2020 , 00:14   Re: [Plugin Idea] Entity Message Editor
Reply With Quote #5

The point I understand is.
1. give the entity a customized message.
2. include %name to display the name of the triggered player.

To do this. presumably.
1. target the entities and execute specific commands.
2. give the entity the message entered in the chat after the command is executed.
(You'll also need to enter a trigger condition at this point. Break, use, move, etc...)
3. when the registered trigger is actually executed on the entity, the granted message is displayed.

@Snake.
Is that correct?
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-16-2020 , 00:33   Re: [Plugin Idea] Entity Message Editor
Reply With Quote #6

Quote:
Originally Posted by +ARUKARI- View Post
The point I understand is.
1. give the entity a customized message.
2. include %name to display the name of the triggered player.

To do this. presumably.
1. target the entities and execute specific commands.
2. give the entity the message entered in the chat after the command is executed.
(You'll also need to enter a trigger condition at this point. Break, use, move, etc...)
3. when the registered trigger is actually executed on the entity, the granted message is displayed.

@Snake.
Is that correct?
I hope this what he want..
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <fakemeta>
#include <cromchat>


new const szPrefix[] = { "&x01[&x04ZE&x01]" };

//Maps Name & Escape Button Name
new const g_MapsAndTargets[][][] =
{
    { 
"ze_jurassickpark2_lg""heli" },
    { 
"ze_jurassickpark3_lg""heli" },
    { 
"ze_JurassicPark4""rescate_jp" },
    { 
"ze_mangocake""escape" },
    { 
"ze_area51_lg""tren_escape" },
    { 
"ze_kia""cake" },
    { 
"ze_assault_escape_lg""heli" },
    { 
"ze_amazonas_beta""rescate_amazonas" },
    { 
"ze_blackmesa_final""msilo" },
    { 
"ze_chaka_escape""gemoroy" },
    { 
"ze_egypt_two_lg""a1" },
    { 
"ze_escapetrain""trem_ati" },
    { 
"ze_hospital_lg""heli_escape" },
    { 
"ze_jungla_lg""heli1" },
    { 
"ze_ice4cap_lg""llamado_escape" },
    { 
"ze_JurassicPark4""rescate_jp" },
    { 
"ze_mario_tower_lg""mario_escape_final_001" },
    { 
"ze_maya_god_final""ttt" },
    { 
"ze_osnapitzari_lg""ascensor_escape" },
    { 
"ze_pueblo_v3_fix""tren" },
    { 
"ze_thelost_lg""escape_final" }

}


public 
plugin_init()
{
     
register_plugin("Breakable & EscapeButton","1.2","MrAbdoO")
     
RegisterHam(Ham_TakeDamage,"func_breakable","FwdHamBreakableKilled",1)
     
RegisterHam(Ham_Use"func_button""Fw_ButtonUsed_Post"1)
}



public 
FwdHamBreakableKilled(entweaponkiller)
{
    if(
entity_get_float(ent,EV_FL_health)<0)
    {
        static 
szName32 ];
        
get_user_namekillerszNamecharsmaxszName ) );
        
CC_SendMessage(0,"%s Player &x05%s&x01 has broken Something."szPrefixszName)
        
set_hudmessage(random(255), random(255), random(255), -1.00.1710.05.01.01.0, -1)
        
show_hudmessage(0"Player %s has broken Something"szName)
        return(
HAM_IGNORED);
    }
    return(
HAM_IGNORED);

}

public 
Fw_ButtonUsed_Post(entid)
{
    new 
mapname[32], targetname[32];
    
get_mapname(mapnamecharsmax(mapname));
    
pev(entpev_targetnametargetnamecharsmax(targetname));
    
    for (new 
0charsmax(g_MapsAndTargets); i++)
    {
        if (
equal(mapnameg_MapsAndTargets[i][0]) && equal(targetnameg_MapsAndTargets[i][1]))
        {
             new 
szName[32];
             
get_user_name(idszNamecharsmax(szName));
             
             
CC_SendMessage(0"%s Player &x05%s&x01 Pressed the call Button, &x07Run Fast&x01 !!!"szPrefixszName)
             
set_hudmessage(random(255), random(255), random(255), -1.00.1710.05.01.01.0, -1)
             
show_hudmessage(0"Player %s Pressed the call Button, Run Fast !!!"szName)

        }
    }

I was want to make cofing file for name of map and button to be easy for you, but i dont have good expriance in confingtions coding

Last edited by Supremache; 06-16-2020 at 00:38.
Supremache is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-16-2020 , 00:55   Re: [Plugin Idea] Entity Message Editor
Reply With Quote #7

Check this, I have added ini file codes for escape botton name try it

If you want to change the chatcolor, i using cromchat.
The colors.
Quote:
&x07 = red
&x06 = blue
&x05 = white
&x04 = green
&x03 = team color
&x01 = normal
&x00 = removes message prefix (only if put in the beginning of the message)
Example:
PHP Code:
 CC_SendMessage(0,"%s Player %s has broken Something."szPrefixszName// without colors
 
CC_SendMessage(0,"%s Player &x05%s&x01 has &x03broken &x04Something."szPrefixszName// with colors 
Attached Files
File Type: inc cromchat.inc (22.2 KB, 34 views)
File Type: inc amx_settings_api.inc (1.4 KB, 32 views)
File Type: sma Get Plugin or Get Source (Breakable_EscapeButton.sma - 100 views - 2.9 KB)

Last edited by Supremache; 06-16-2020 at 01:46. Reason: ColorChat Example....
Supremache is offline
Snake.
Senior Member
Join Date: Jul 2017
Old 06-16-2020 , 06:34   Re: [Plugin Idea] Entity Message Editor
Reply With Quote #8

Quote:
Originally Posted by +ARUKARI- View Post
The point I understand is.
1. give the entity a customized message.
2. include %name to display the name of the triggered player.

To do this. presumably.
1. target the entities and execute specific commands.
2. give the entity the message entered in the chat after the command is executed.
(You'll also need to enter a trigger condition at this point. Break, use, move, etc...)
3. when the registered trigger is actually executed on the entity, the granted message is displayed.

@Snake.
Is that correct?
Yes something like that.
Snake. is offline
Send a message via Skype™ to Snake.
Snake.
Senior Member
Join Date: Jul 2017
Old 06-16-2020 , 06:36   Re: [Plugin Idea] Entity Message Editor
Reply With Quote #9

Quote:
Originally Posted by Supremache View Post
Check this, I have added ini file codes for escape botton name try it

If you want to change the chatcolor, i using cromchat.
The colors.


Example:
PHP Code:
 CC_SendMessage(0,"%s Player %s has broken Something."szPrefixszName// without colors
 
CC_SendMessage(0,"%s Player &x05%s&x01 has &x03broken &x04Something."szPrefixszName// with colors 
Thank you for trying but none of them is not exactly what i want. Are you sure you read the whole description ?
Snake. is offline
Send a message via Skype™ to Snake.
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-16-2020 , 07:00   Re: [Plugin Idea] Entity Message Editor
Reply With Quote #10

Quote:
Originally Posted by Snake. View Post
Thank you for trying but none of them is not exactly what i want. Are you sure you read the whole description ?
What did I not do? give me exmaple or picture for what you want, the plugin work like if anyone had broke anything will show in chat [player "name" has broked something] and when someone pressed on escape bottun will show message in the public chat [ player "name" pressed on escape button, Run fast!!] is that what you want or not ?!!!!!
Supremache is offline
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 03:17.


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