Raised This Month: $ Target: $400
 0% 

Problem with PrintToChatAll


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BAILANDO
Senior Member
Join Date: Feb 2015
Location: Slovakia
Old 02-24-2015 , 16:37   Problem with PrintToChatAll
Reply With Quote #1

<sourcemod>

Hello, i made plugin for print to chat if player teamattack teammate and one command for say into chat. But onmapspawn i say with /svip only one message, is good and message when player teamattack teammate only one time printed in chat, but after couple of time, if i say /svip message or player attack teammate, server print this message 3 times, no only once. How can i fix this please?

Here is paste for chat command /svip for example:

public Action:VipSprava(client, args){
new String:meno[32], String:Arg1[128];
GetClientName(client, meno, sizeof(meno));
//GetCmdArg(1, Arg1, sizeof(Arg1));
GetCmdArgString(Arg1, sizeof(Arg1));
if(args < 1){
PrintToChat(client, "\x04[VIP Sprava] \x03Tvar prikazu: \x04sm_svip <sprava> alebo !svip <sprava> alebo /svip <sprava>");
PrintToConsole(client, "\x04[VIP Sprava] \x03Tvar prikazu: \x04sm_svip <sprava> alebo !svip <sprava> alebo /svip <sprava>");
return Plugin_Handled;
}
else{
PrintToChatAll("\x04[VIP Sprava] \x01od \x03%s : \x04%s", meno, Arg1);
return Plugin_Handled;
}
}

Thanks for help.
Attached Images
File Type: jpg sprava.jpg (82.5 KB, 132 views)
BAILANDO is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 02-24-2015 , 16:57   Re: Problem with PrintToChatAll
Reply With Quote #2

most likely VipSprava is being registered more than once. Post entire code to help find the bug easier.
Mitchell is offline
BAILANDO
Senior Member
Join Date: Feb 2015
Location: Slovakia
Old 02-24-2015 , 17:27   Re: Problem with PrintToChatAll
Reply With Quote #3

i ask, can be problem, if i register regadmincmd onmapstart and not on onpluginstart? i forgot for this and now maybe work fine.
BAILANDO 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 23:02.


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