AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   JCTF + GunGame (https://forums.alliedmods.net/showthread.php?t=253320)

Spirit_12 12-20-2014 02:02

JCTF + GunGame
 
I was looking to run JCTF and GunGame mods side by side. What I need to make this more interesting is that flag captures to increase GunGame levels. I read the JCTF api and it's fairly simple. My question here is. What kind of trigger can I use in JCTF, since GunGame has no api.

Is there any way to use amx_gungame_level <target> <level> to your advantage? If that's not going to work, then is there any other way to increase level on flag capture? I know, it's possible in some way or another, as I have seen it on a server.

Links:


YamiKaitou 12-20-2014 07:48

Re: JCTF + GunGame
 
Quote:

Originally Posted by Spirit_12 (Post 2237399)
Is there any way to use amx_gungame_level <target> <level> to your advantage?

http://amxmodx.org/api/amxmodx/server_cmd
http://amxmodx.org/api/amxmodx/console_cmd

Spirit_12 12-22-2014 02:33

Re: JCTF + GunGame
 
Thanks for the reply Yami. I have the code, but it won't pin point the person who triggered the event.

PHP Code:

/* id = player who captured the enemy (iFlagTeam) flag */
new cmd[129]
format(cmd,128"amx_gungame_level id +1");
server_cmd(cmd); 

I have tried it with other options for cvar like @ALL, @TERRORIST and @CT, but I need to pin point that specific player, who triggered the event. Upon the event trigger, I get this.

Quote:

Client with that name or userid not found

YamiKaitou 12-23-2014 11:50

Re: JCTF + GunGame
 
You either need to pass the #UserID or the Name of the player

Spirit_12 12-24-2014 20:28

Re: JCTF + GunGame
 
For some reason the cvar amx_gungame_level won't work with userid. I converted the user index into userid and console still prints the same message.

Quote:

Client with that name or userid not found
Just to double check everything I even tried to do the same thing manually. With that being said, my other option was to use name. Name works fine with the command, but the issue is when we have a name with space.

Example: amx_gungame_level tag name +1

When server sends the command, it treats "tag" "name" as two arguments, when it should consider "tag name" as one and "+1" as the other. How would I be able to fix this? Is there any solution?

YamiKaitou 12-25-2014 07:00

Re: JCTF + GunGame
 
Please show us exactly what you have tried so we can determine the correct way to assist you

Spirit_12 12-25-2014 09:41

Re: JCTF + GunGame
 
PHP Code:

/* id = player index who captured the enemy (iFlagTeam) flag */ 
            
new name[32]
            
get_user_name(idname31)
            if(
iFlagTeam == 2)
                {
                new 
cmd[129]
                
format(cmd,128"amx_gungame_level %s +1"name);
                
server_cmd(cmd);} 

As you can see, I'm converting the index into player name and then using that in the GunGame plugin command, but the issue is that, if there is a space in your name, then command takes it as 2 arguments, as opposed to 1.

YamiKaitou 12-25-2014 11:00

Re: JCTF + GunGame
 
format(cmd,128, "amx_gungame_level ^"%s^" +1", name);

breakzuza 01-10-2015 15:32

Re: JCTF + GunGame
 
Quote:

Originally Posted by Spirit_12 (Post 2239836)
PHP Code:

/* id = player index who captured the enemy (iFlagTeam) flag */ 
            
new name[32]
            
get_user_name(idname31)
            if(
iFlagTeam == 2)
                {
                new 
cmd[129]
                
format(cmd,128"amx_gungame_level %s +1"name);
                
server_cmd(cmd);} 


hey....can someone help me with this?..to explain me how to add this on plugin?..i've tryed a lot of things but not worked...plugin dosent compile...

Spirit_12 01-13-2015 17:47

Re: JCTF + GunGame
 
Quote:

Originally Posted by breakzuza (Post 2247515)
hey....can someone help me with this?..to explain me how to add this on plugin?..i've tryed a lot of things but not worked...plugin dosent compile...

It won't compile, because its not the whole code. I just posted the section that, I was having issues with. The actual code includes jctf api and some GunGame commands. Its really not that hard to be honest, just try to look into amxmodx documentation and I'm sure you can figure it out.

http://www.amxmodx.org/doc/

Also this method is not that efficient. The only reason why I went with it was because, I wanted to create a sub-plugin that won't require any change to main plugins.


All times are GMT -4. The time now is 15:26.

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