Raised This Month: $51 Target: $400
 12% 

Hook Chat?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
marih
Junior Member
Join Date: Aug 2013
Old 02-26-2015 , 13:59   Hook Chat?
Reply With Quote #1

The plugin got the client to enter a integer number. so the client enter the integer in chat. then, the plugin get that and use as constant.

how to?

Last edited by marih; 02-26-2015 at 14:00.
marih is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 02-26-2015 , 14:20   Re: Hook Chat?
Reply With Quote #2

AddCommandListener(Command_PlayerSay, "say");
AddCommandListener(Command_PlayerSay, "say_team");

Get the text in the Command_PlayerSay section
PHP Code:
public Action:Command_PlayerSay(client, const String:command[], argc)
{
    
// Get stuff here with GetCmdArg
    // return Plugin_Handled to not let player text go on screen, or Plugin_Continue to let it be sent

__________________
View my Plugins | Donate

Last edited by TnTSCS; 02-26-2015 at 14:24.
TnTSCS is offline
psychonic

BAFFLED
Join Date: May 2008
Old 02-26-2015 , 14:26   Re: Hook Chat?
Reply With Quote #3

I would highly advise against manually adding a command listener and instead using the OnClientSayCommand forward. It plays nicer with other SM functionality.
psychonic is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 02-26-2015 , 14:28   Re: Hook Chat?
Reply With Quote #4

I forgot about that one.
__________________
View my Plugins | Donate
TnTSCS is offline
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 02-26-2015 , 14:29   Re: Hook Chat?
Reply With Quote #5

Quote:
Originally Posted by TnTSCS View Post
AddCommandListener(Command_PlayerSay, "say");
AddCommandListener(Command_PlayerSay, "say_team");

Get the text in the Command_PlayerSay section
PHP Code:
public Action:Command_PlayerSay(client, const String:command[], argc)
{
    
// Get stuff here with GetCmdArg
    // return Plugin_Handled to not let player text go on screen, or Plugin_Continue to let it be sent

I believe we should start to provide 1.7 synthax examples, so it would be clearer for newbies from the begining.
LambdaLambda is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 02-26-2015 , 14:31   Re: Hook Chat?
Reply With Quote #6

that would mean I have to start to learn the new syntax too
__________________
View my Plugins | Donate
TnTSCS is offline
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 02-27-2015 , 02:49   Re: Hook Chat?
Reply With Quote #7

Quote:
Originally Posted by TnTSCS View Post
that would mean I have to start to learn the new syntax too
Open your notepad then
LambdaLambda is offline
marih
Junior Member
Join Date: Aug 2013
Old 02-27-2015 , 03:15   Re: Hook Chat?
Reply With Quote #8

ok guys thanks a lot. but i have another problem now.

Code:
AddCommandListener(Command_PlayerSay, "say");
	//AddCommandListener(Command_PlayerSay, "say_team");
	AddUnusualEffect(iClient, ClientSteamID[ClientControl[iClient]], ClientItems[iClient], Quality[iClient], StringToInt(Effect), ClientIndex[iClient]);
i thought the plugin listen to Command_Playersay until it returns the value. (The plugin doesn't run next line just wait for the return.)

but when it excuted, it seems that plugin listen to command_playersay but don't wait for the return. just run the nextline)

sorry for my bad english. what am i gonna do
marih is offline
neatek
AlliedModders Donor
Join Date: Jul 2010
Location: Russia
Old 02-27-2015 , 07:51   Re: Hook Chat?
Reply With Quote #9

[OFFTOP]
Quote:
Originally Posted by marih View Post
i thought the plugin listen to Command_Playersay until it returns the value. (The plugin doesn't run next line just wait for the return.)
https://forums.alliedmods.net/showthread.php?t=258921

Do not repeat please, its not good way to get answer faster
[/OFFTOP]
__________________
neatek is offline
marih
Junior Member
Join Date: Aug 2013
Old 02-27-2015 , 20:08   Re: Hook Chat?
Reply With Quote #10

Quote:
Originally Posted by neatek View Post
[OFFTOP]


https://forums.alliedmods.net/showthread.php?t=258921

Do not repeat please, its not good way to get answer faster
[/OFFTOP]
Sorry, anyway solved problem with your way
marih 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 01:38.


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