Raised This Month: $ Target: $400
 0% 

Plugin message...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AtomicServers
Junior Member
Join Date: Jul 2013
Location: Sofia, Bulgaria
Old 08-08-2013 , 18:45   Plugin message...
Reply With Quote #1

Hello everyone! I want to ask for help with message code. I want to put a message in a plugin that all players will see on every 30 seconds but I don't know how and what is the code I should put into plugin. I'm new here, still learning!

Example of plugin message:
To restart your score write /rs.

30 seconds later:
To restart your score write /rs.

I hope you got my question. Waiting for answers!

Last edited by AtomicServers; 08-08-2013 at 19:45.
AtomicServers is offline
Send a message via Skype™ to AtomicServers
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-08-2013 , 20:22   Re: Plugin message...
Reply With Quote #2

Really simple example.
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Advertise", "", "");     set_task(30.0, "advertise", 123509812, _, _, "b"); // This calls the function "advertise" on set time (30 seconds in this case). The "b" flag loops it forever. } public advertise() {     client_print(0, print_chat, "To restart your score write /rs."); // This prints a chat message to everyone. }
__________________

Last edited by Black Rose; 08-09-2013 at 07:37.
Black Rose is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 08-08-2013 , 20:32   Re: Plugin message...
Reply With Quote #3

Quote:
Originally Posted by Black Rose View Post
Really simple example.
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Advertise", "", "");     set_task(30.0, "advertise", 123509812, "b"); // This calls the function "advertise" on set time (30 seconds in this case). The "b" flag loops it forever. } public advertise() {     client_print(0, print_chat, "To restart your score write /rs."); // This prints a chat message to everyone. }
Bad way you should set_task at connect
And only show for id and not evryone
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 08-08-2013 at 20:33.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-08-2013 , 21:27   Re: Plugin message...
Reply With Quote #4

Quote:
Originally Posted by ironskillz1 View Post
Bad way you should set_task at connect
And only show for id and not evryone
or say it on spawn or hooking chat and checking for certain words.


spawn would be best...

as 32 timers isnt the best way
Doc-Holiday is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-08-2013 , 23:06   Re: Plugin message...
Reply With Quote #5

Quote:
Originally Posted by ironskillz1 View Post
Bad way you should set_task at connect
And only show for id and not evryone
Why?
__________________
Black Rose is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-09-2013 , 00:28   Re: Plugin message...
Reply With Quote #6

flags argument position is wrong, or you have forgotten to named it ;)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
zi443r
Senior Member
Join Date: Mar 2009
Location: Braila,Romania
Old 08-09-2013 , 00:31   Re: Plugin message...
Reply With Quote #7

this will do the trick: https://forums.alliedmods.net/showthread.php?t=27814
__________________
zi443r is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-09-2013 , 07:39   Re: Plugin message...
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
flags argument position is wrong, or you have forgotten to named it ;)


Fixed.
__________________

Last edited by Black Rose; 08-09-2013 at 07:39.
Black Rose 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 22:18.


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