AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved Add item and fix this (https://forums.alliedmods.net/showthread.php?t=329315)

ho83 12-18-2020 10:09

Add item and fix this
 
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.

ho83 12-23-2020 09:47

Re: Add item and fix this
 
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 12-28-2020 11:02

Re: Add item and fix this
 
bump

fysiks 12-28-2020 22:24

Re: Add item and fix this
 
It would probably be better to edit the plugin whose functionality you are trying to change.

ho83 12-29-2020 03:53

Re: Add item and fix this
 
Quote:

Originally Posted by fysiks (Post 2730521)
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?

fysiks 12-29-2020 15:29

Re: Add item and fix this
 
Quote:

Originally Posted by ho83 (Post 2730537)
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 (Post 2730537)
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.

ho83 12-29-2020 16:35

Re: Add item and fix this
 
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

fysiks 12-30-2020 03:47

Re: Add item and fix this
 
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.


All times are GMT -4. The time now is 21:20.

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