AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Client print time, command (https://forums.alliedmods.net/showthread.php?t=21816)

pulpy 12-11-2005 04:27

Client print time, command
 
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.

VEN 12-11-2005 06:43

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 }

Twilight Suzuka 12-11-2005 11:10

Also, the language's name is PAWN, not SMALL.

MaximusBrood 12-11-2005 14:59

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 :wink:

(also the BBCode tags are still for small)

Twilight Suzuka 12-11-2005 16:18

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 :wink:

(also the BBCode tags are still for small)

Sure it matters. It matters A PLENTY!!!


All times are GMT -4. The time now is 15:47.

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