Raised This Month: $ Target: $400
 0% 

Help with simple plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jozzz
Member
Join Date: May 2012
Old 08-01-2012 , 18:42   Help with simple plugin
Reply With Quote #1

Hello

I am running GunGame and I was wondering if someone could help me with a simple plugging or a way to execute a command at the end of the map when the motd pops up. For now I just would like to execute the command right at the end of the map and then execute another command at the start of the next round. Or at least execute a command at the end of the map when the motd pops up, because I can add the other command to the amxx.cfg to be executed when the next map starts

I found this script but I can't make it work. I don't need the exact same thing, I Just need to execute one simple server command at the end of the map.

http://forums.alliedmods.net/showthread.php?p=1758457

Anyone can help me?

Thanks in advance.
jozzz is offline
jozzz
Member
Join Date: May 2012
Old 08-05-2012 , 12:04   Re: Help with simple plugin
Reply With Quote #2

I am sure there are a lot of experts here, it is a very simple thing. Nobody can help??

Last edited by jozzz; 08-05-2012 at 12:05.
jozzz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-05-2012 , 16:29   Re: Help with simple plugin
Reply With Quote #3

You want to execute a command at the end of a map or when a MOTD pops up . . . Which one is it. If you are actually referring to the MOTD, to which MOTD are you referring?
__________________
fysiks is offline
jozzz
Member
Join Date: May 2012
Old 08-05-2012 , 18:14   Re: Help with simple plugin
Reply With Quote #4

I am running GunGame, when any player gets his last kill, the map ends and the motd pops up saying [GunGame] Amxx Player Won, etc.... something must trigger that motd to pop up. I want to execute a simple server side command at that exact moment. Which would be maybe something like this?

server_cmd("bot_stop 1");

Last edited by jozzz; 08-05-2012 at 20:37.
jozzz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-08-2012 , 20:39   Re: Help with simple plugin
Reply With Quote #5

Quote:
Originally Posted by jozzz View Post
something must trigger that motd to pop up.
Yeah, the plugin.

Quote:
Originally Posted by jozzz View Post
I want to execute a simple server side command at that exact moment. Which would be maybe something like this?

server_cmd("bot_stop 1");
You need to edit GunGame.
__________________
fysiks is offline
jozzz
Member
Join Date: May 2012
Old 08-08-2012 , 21:06   Re: Help with simple plugin
Reply With Quote #6

Well I am not an expert, I thought that just a simple script that recognizes when the map has finished and when motd has poped up, could execute this command. I think when the winner makes his last kill then something not only triggers the motd to pop up but also ends the map because after that it changes to another map, so I guess this script would just detect when the map has ended and excecute the command, so it wouldn't be neccesary to touch gungame?
But you are the expert so in that case I am completly lost since I don't know how to modify the complex gungame plugin to achieve this.

Last edited by jozzz; 08-08-2012 at 22:58.
jozzz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-10-2012 , 19:07   Re: Help with simple plugin
Reply With Quote #7

Quote:
Originally Posted by jozzz View Post
Well I am not an expert, I thought that just a simple script that recognizes when the map has finished and when motd has poped up, could execute this command. I think when the winner makes his last kill then something not only triggers the motd to pop up but also ends the map because after that it changes to another map, so I guess this script would just detect when the map has ended and excecute the command, so it wouldn't be neccesary to touch gungame?
But you are the expert so in that case I am completly lost since I don't know how to modify the complex gungame plugin to achieve this.
Well, if you don't actually need it when the MOTD shows (which you can't hook from an external plugin) you should just use when the map changes which is simple. Just put your command in plugin_end() of a new plugin or any existing plugin (but would recommend a new plugin.

PHP Code:
#include <amxmodx>
public plugin_end()
{
    
// command here.

__________________
fysiks is offline
jozzz
Member
Join Date: May 2012
Old 08-10-2012 , 19:42   Re: Help with simple plugin
Reply With Quote #8

Thank you fysiks, this is is doing its work, but the effects only take place when the next map starts. However, checking the GunGame plugin I see this word a lot: "roundEnded", so it seems to me that we need this plugin to do its work at the end of the round instead. So maybe it just needs a little modification?

Last edited by jozzz; 08-10-2012 at 19:51.
jozzz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-11-2012 , 00:11   Re: Help with simple plugin
Reply With Quote #9

Earlier you said the end of the map which is the same as when the map changes and that is what I gave you. You will have to be more specific about your setup and what exactly you want to do with the "command".
__________________
fysiks is offline
jozzz
Member
Join Date: May 2012
Old 08-11-2012 , 00:55   Re: Help with simple plugin
Reply With Quote #10

Ok, sorry for not being specific. I don't know anything about scripting, programing or stuff like that, I am just starting with all this, so apologies if my explanations are confusing or not clear.

After I tried the plugin you gave me, I noticed the changes were taking effect when starting the next map, then I decided to check the gungame plugin to see what I could find so I thought that "roundEnded" could mean that this should be applied to the end of the round instead of the end of the map. Because when playing normal Counter Strike, I know that a round ends and restarts several times until the time of the map is over, but the map ends only once and then it changes to another map.

So I am just assuming it has to be one of two options, if it is not the "end of the map" then it would have to be the "end of the round". Also when playing gungame there are no rounds, the game flows continuously until someone wins and then it changes to another map. Maybe the end of a map in gungame is actually the end of a round and at that right moment, the pluging changes the game to another map. I don't really know, just assuming.

The command I need is just a simple server command: "bot_stop 1" which I found inside another plugin writen this way: server_cmd("bot_stop 1");
So I supose this is the way it should be writen inside a plugin, and that is what I did with the plugin you gave me. And it worked like I described before, taking effect when the next map started.

It could be any command like sv_alltalk, sv_voiceenable, etc. you know just any command that you can type in the console. When I type this command: "bot_stop 1" or any server command in the console it executes instantly, so I basically need this plugin to execute this command automatically when the round ends (since it is obviously not the end of the map), like if I was typing it in the console.

Thank you again for taking your time to help me.

Last edited by jozzz; 08-11-2012 at 00:58.
jozzz is offline
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 19:26.


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