Raised This Month: $ Target: $400
 0% 

Client print time, command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pulpy
Senior Member
Join Date: Oct 2005
Location: Brights Grove, ON
Old 12-11-2005 , 04:27   Client print time, command
Reply With Quote #1

hey guys, im learning small, and i got a question. Im trying to make a plugin that will print to client every X sec. I have 3 things that i would like it to print, but all at seperate times. So for example i want it to print something at 60 sec, then something else at 120 sec, then something else at 180 sec, and then repeat. Right now for some reason they all print at 90sec. heres my code, maybe someone can tell me what im missing heh.

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Chat Info" #define VERSION "0.1" #define AUTHOR "Solor" public plugin_init() {     register_plugin("Chat Info", "0.1", "Solor")     register_cvar("Advertise","60")         set_task(get_cvar_float("Advertise"),"advertise" , _ , _ , _ , "b")     register_cvar("Advertise2","120")         set_task(get_cvar_float("Advertise2"),"advertise2" , _ , _ , _ , "b")     register_cvar("Advertise3","180")         set_task(get_cvar_float("Advertise3"),"advertise3" , _ , _ , _ , "b") } public advertise() {     client_print(0,print_chat,"[INFO] Our website is www.ImmortalGamers.com")     return PLUGIN_HANDLED } public advertise2() {     client_print(0,print_chat,"[INFO] We currently have 2 servers. Please type /servers for more info")     return PLUGIN_HANDLED } public advertise3() {     client_print(0,print_chat,"[INFO] We are in need of paying Admins. If interested type /donate for more info")     return PLUGIN_HANDLED }

thanks.
__________________
pulpy is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-11-2005 , 06:43  
Reply With Quote #2

Use this way:
Code:
// new g_msgid your_print_function() {     switch (g_msgid) {         case 0: // print message #1         case 1: // print message #2         case 2: // print message #3     }     g_msgid++     g_msgid %= 3 }
VEN is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 12-11-2005 , 11:10  
Reply With Quote #3

Also, the language's name is PAWN, not SMALL.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 12-11-2005 , 14:59  
Reply With Quote #4

Quote:
Originally Posted by Twilight Suzuka
Also, the language's name is PAWN, not SMALL.
It doesnt really matter, since everyone knows what the other means

(also the BBCode tags are still for small)
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 12-11-2005 , 16:18  
Reply With Quote #5

Quote:
Originally Posted by MaximusBrood
Quote:
Originally Posted by Twilight Suzuka
Also, the language's name is PAWN, not SMALL.
It doesnt really matter, since everyone knows what the other means

(also the BBCode tags are still for small)
Sure it matters. It matters A PLENTY!!!
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Old 05-17-2010, 08:46
abdul-rehman
This message has been deleted by abdul-rehman.
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 15:47.


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