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

PrintToChat compile error?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 05-19-2014 , 08:47   PrintToChat compile error?
Reply With Quote #1

Hey guys.

So I'm trying to write a small plugin that will reboot my server(s) at 12:00 AM every morning, however I am also wanting the plugin to print a message to chat every 10 minutes and once 10 minutes BEFORE the restart. I'm unsure how to tell my script to print a chat message every x minutes though and was hoping you guys could help?

Could you awesome people help me with this? Thank you.
__________________

Last edited by HiddenConn1; 05-19-2014 at 12:01. Reason: Removed sourcecode
HiddenConn1 is offline
2NASTY4U
Senior Member
Join Date: Mar 2014
Old 05-19-2014 , 08:52   Re: PrintToChat compile error?
Reply With Quote #2

Why do write a plugin for this? Search for Popoklopsi's Cronjob plugin. Will work perfectly for this.

Edit: You have to use CPrintToChatAll. lol. And use #include <colors> instead of #include colors.

Last edited by 2NASTY4U; 05-19-2014 at 09:04. Reason: Problem fixed
2NASTY4U is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 05-19-2014 , 09:04   Re: PrintToChat compile error?
Reply With Quote #3

There is a big fight between PrintToChat and PrintToChatAll ;-)

btw. read compiler errors

Last edited by KissLick; 05-19-2014 at 09:04.
KissLick is offline
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 05-19-2014 , 10:29   Re: PrintToChat compile error?
Reply With Quote #4

in PrintToChat first parameter is client that you want to display notification.

if you want to display it for everybody, then you should use PrintToChatAll - or use for loop, but it does not really make sense to use that.
LambdaLambda is offline
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 05-19-2014 , 11:56   Re: PrintToChat compile error?
Reply With Quote #5

Quote:
Originally Posted by 2NASTY4U View Post
Why do write a plugin for this? Search for Popoklopsi's Cronjob plugin. Will work perfectly for this.

Edit: You have to use CPrintToChatAll. lol. And use #include <colors> instead of #include colors.
I didn't really have the time to search Google or AM for a plugin for it that would do exactly what I wanted it to so I thought I'd try and quickly write one instead.
Quote:
Originally Posted by KissLick View Post
There is a big fight between PrintToChat and PrintToChatAll ;-)

btw. read compiler errors
Thanks for the links. I'm wanting to use PrintToChatAll so it prints the notice on the servers to all players.
Quote:
Originally Posted by LambdaLambda View Post
in PrintToChat first parameter is client that you want to display notification.

if you want to display it for everybody, then you should use PrintToChatAll - or use for loop, but it does not really make sense to use that.
EDIT: I added "#include <colors>" but I still get this:
Code:
Your plugin failed to compile! Read the errors below:

SourcePawn Compiler 1.5.0-dev+3889
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC

/home/groups/sourcemod/upload_tmp/phprAIHB2.sp(3) : fatal error 120: cannot read from file: "colors"

Compilation aborted.
1 Error.
__________________

Last edited by HiddenConn1; 05-19-2014 at 12:01.
HiddenConn1 is offline
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 05-19-2014 , 13:30   Re: PrintToChat compile error?
Reply With Quote #6

You DON'T have to use CPrintToChatAll. This function is extended version of default PrintToChatAll that comes with COLORS library.

However, you can if you want. But make sure you have downloaded colors.inc and placed it in include directory (scripting/include - compiler side).

Last edited by LambdaLambda; 05-19-2014 at 13:31.
LambdaLambda is offline
2NASTY4U
Senior Member
Join Date: Mar 2014
Old 05-19-2014 , 19:39   Re: PrintToChat compile error?
Reply With Quote #7

Quote:
Originally Posted by HiddenConn1 View Post
EDIT: I added "#include <colors>" but I still get this:
Code:
Your plugin failed to compile! Read the errors below:

SourcePawn Compiler 1.5.0-dev+3889
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC

/home/groups/sourcemod/upload_tmp/phprAIHB2.sp(3) : fatal error 120: cannot read from file: "colors"

Compilation aborted.
1 Error.
lol. You're using webcompiler to compile? In regular webcompiler you can not add third party includes like colors.inc. You have to download colors.inc, after this, use asherkin's webcompiler spider or compile it locally.
2NASTY4U is offline
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 05-20-2014 , 09:41   Re: PrintToChat compile error?
Reply With Quote #8

Quote:
Originally Posted by 2NASTY4U View Post
lol. You're using webcompiler to compile? In regular webcompiler you can not add third party includes like colors.inc. You have to download colors.inc, after this, use asherkin's webcompiler spider or compile it locally.
Yes because PawnStudio won't compile anything. It just gives an error and I just can't be bothered searching the error to fix it.
__________________
HiddenConn1 is offline
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 05-20-2014 , 09:58   Re: PrintToChat compile error?
Reply With Quote #9

Go get lasted SM snapshot for Windows, and unpack scripting folder only.
LambdaLambda 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:39.


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