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

Solved AddCommandListener broken?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nekoz
Member
Join Date: Oct 2016
Old 07-18-2017 , 18:18   AddCommandListener broken?
Reply With Quote #1

AddCommandListener only trigger it once...
I put my AddCommandListener in OnPluginStart. It work when plugin load or reload. But when map change, it stop working. It suppose to be like that? Or I'm missing something...

Last edited by Nekoz; 07-24-2017 at 21:58.
Nekoz is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 07-18-2017 , 18:29   Re: AddCommandListener broken?
Reply With Quote #2

Hi, Please post your code. AddCommandListener should work fine.
WatchDogs is offline
inklesspen
Member
Join Date: Nov 2015
Location: Russia, Moscow
Old 07-19-2017 , 03:23   Re: AddCommandListener broken?
Reply With Quote #3

Game is...? csgo? css? modular combat or another mod?
__________________
Mai inglish is veri gud!

Last edited by inklesspen; 07-19-2017 at 03:30.
inklesspen is offline
Send a message via Skype™ to inklesspen
stephen473
Senior Member
Join Date: Jan 2017
Location: somewhere on earth
Old 07-19-2017 , 05:48   Re: AddCommandListener broken?
Reply With Quote #4

You must send your code
__________________
Also known as Hardy`.

Feel free to contact me if you have a private plugin request!

My Steam Profile | Discord: Hardy`#3792
stephen473 is offline
StrikeR14
AlliedModders Donor
Join Date: Apr 2016
Location: Behind my PC
Old 07-19-2017 , 08:06   Re: AddCommandListener broken?
Reply With Quote #5

What command listener are you trying to hook?
StrikeR14 is offline
sazonische
Senior Member
Join Date: Dec 2013
Old 07-23-2017 , 07:43   Re: AddCommandListener broken?
Reply With Quote #6

Quote:
Originally Posted by inklesspen View Post
Game is...? csgo? css? modular combat or another mod?
https://github.com/zadroot/JointeamC...ng/jointeam.sp
AddCommandListener(OnJoinTeam, "jointeam");

Mod cs go

Last edited by sazonische; 07-23-2017 at 07:43.
sazonische is offline
Send a message via Skype™ to sazonische
Nekoz
Member
Join Date: Oct 2016
Old 07-24-2017 , 06:38   Re: AddCommandListener broken?
Reply With Quote #7

I use this plugin
https://forums.alliedmods.net/showthread.php?p=1506666

And for game insurgency
I try to mess around with the code still doesn't work
I even try RegConsoleCmd for it
It work but when map change it stop working again
So I put it in OnMapStart
Same thing happen...

Not sure how you fix that
Tried everything, no luck
It only trigger once

My only guess is the sourcemod get trigger first when map change
Making the original command replace the one from sourcemod
I should probably try add a timer to delay it

Last edited by Nekoz; 07-24-2017 at 06:59.
Nekoz is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 07-24-2017 , 07:11   Re: AddCommandListener broken?
Reply With Quote #8

AddCommandListener works fine, don't edit the plugin. Reading the plugin thread tells you that it is incompatible with Insurgency and is only made with TF2 in mind.
hmmmmm is offline
Nekoz
Member
Join Date: Oct 2016
Old 07-24-2017 , 19:28   Re: AddCommandListener broken?
Reply With Quote #9

I did some PrintToChat
It seem like it overlap on each other
When a vote start, it start 2 votes in the background instead of 1
The plugin only pick up the first vote with empty arguments so the original vote continue with the 2nd one
I'm not sure why it happen...

EDIT: I just do a simple PrintToChat on that command

PHP Code:
public OnPluginStart()
{
    
AddCommandListener(callvoteListener"callvote");
}

public 
Action:callvoteListener(client, const String:cmd[], argc)
{
    
PrintToChat(client"Testing");
    return 
Plugin_Continue;

That callvote fire twice after map change... when I only callvote 1 time. Unless i reload the plugin. But when map change again, it fire twice again.
I'm not sure why AddCommandListener is like that
So instead of hooking the cvar, it actually create an alternative one?


EDIT 2: Just feel stupid LOL... It was actually sourcemod version causing it...
Now it working

Last edited by Nekoz; 07-24-2017 at 21:04.
Nekoz 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:44.


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