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

Solved Add item and fix this


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 12-18-2020 , 10:09   Add item and fix this
Reply With Quote #1

Hi. I have this plugin but i don't know why not work.
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Disable The Goddamn Plugins"
#define VERSION "1.0"
#define AUTHOR "mmd"


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("DeathMsg""onDeathMsgEvent""a")
}

public 
onDeathMsgEvent()
{
    if((
get_playersnum_ex(GetPlayers_ExcludeDead GetPlayers_MatchTeam"TERRORIST") == 1)) {
        
server_cmd("amx_pausecfg pause puginname.amxx")    
    }
    else if(((
get_playersnum_ex(GetPlayers_ExcludeDead GetPlayers_MatchTeam"TERRORIST") != 1)) || (get_playersnum_ex(GetPlayers_ExcludeDead GetPlayers_MatchTeam"CT") == 0)) {
        
server_cmd("amx_pausecfg enable puginname.amxx")
    }

I want when 1 TR is alive, Server_cmd Run a Command and when 2 TR Alive Server_cmd Run another Command.
also I want when Server See This Words in chat[like today is special day] server cmd run another Command .
Thanks.

Last edited by ho83; 01-05-2021 at 07:22.
ho83 is offline
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 12-23-2020 , 09:47   Re: Add item and fix this
Reply With Quote #2

bump.
In fact, the first part of the plugin works well,:
PHP Code:
    if((get_playersnum_ex(GetPlayers_ExcludeDead GetPlayers_MatchTeam"TERRORIST") == 1)) {
        
server_cmd("amx_pausecfg pause puginname.amxx")    
    } 
but the second part has a problem:
PHP Code:
    else if(((get_playersnum_ex(GetPlayers_ExcludeDead GetPlayers_MatchTeam"TERRORIST") != 1)) || (get_playersnum_ex(GetPlayers_ExcludeDead GetPlayers_MatchTeam"CT") == 0)) {
        
server_cmd("amx_pausecfg enable puginname.amxx")
    } 
The problem with the second part is that you have to wait until someone from the CT team Die to make the plugin work.
Can Someone Fix it? Thanks
ho83 is offline
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 12-28-2020 , 11:02   Re: Add item and fix this
Reply With Quote #3

bump
ho83 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-28-2020 , 22:24   Re: Add item and fix this
Reply With Quote #4

It would probably be better to edit the plugin whose functionality you are trying to change.
__________________
fysiks is offline
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 12-29-2020 , 03:53   Re: Add item and fix this
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
It would probably be better to edit the plugin whose functionality you are trying to change.
Thank You sir. I can add a cvar and if one Tr player was alive, The plugin will stop. But My problem is in the second part of my request
Ithink you played in a server with jailbreak mode. This mods have special days. When a special day begins,Mode automatically displays a message to all players in the chat. Like
" Today is war day. Start by an"
How can i add a cvar ,When this message is shown in the chat, the Enable or disable the plugin?
ho83 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-29-2020 , 15:29   Re: Add item and fix this
Reply With Quote #6

Quote:
Originally Posted by ho83 View Post
Ithink you played in a server with jailbreak mode. This mods have special days. When a special day begins,Mode automatically displays a message to all players in the chat. Like
" Today is war day. Start by an"
Never played such a thing.

Quote:
Originally Posted by ho83 View Post
How can i add a cvar ,When this message is shown in the chat, the Enable or disable the plugin?
How do you expect me to answer a coding question about a specific plugin without code? Post a link to the plugin (if it's on these forums; otherwise attach the .sma). Then, explain exactly what you want disabled and when so that someone can actually do something.
__________________
fysiks is offline
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 12-29-2020 , 16:35   Re: Add item and fix this
Reply With Quote #7

First of all, thank you for your reply. Unfortunately I do not have .sma
I think you have seen plugins that limit swearing and bad words in chat. I want a plugin like this but with a different function. I would like if the plugin sees the message that I specified in the chat, For example, do this:
server_cmd("amx_restaert 5").
And when the new round starts, the plugin does a new job.

If this is not possible, Is it possible to add code to the plugin that the plugin will Stop if it sees a message in the chat?

sorry for my English
ho83 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-30-2020 , 03:47   Re: Add item and fix this
Reply With Quote #8

You're not making much sense. What plugin are you trying to disable and what does it do?

A plugin that takes a command from a player and sends a command to the server is trivial. Create a thread to request such a plugin but make sure that you provide ALL the details about what it is supposed to do.
__________________
fysiks 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 19:45.


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