AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with set_task() (https://forums.alliedmods.net/showthread.php?t=3431)

Dygear 07-06-2004 14:56

Help with set_task()
 
I cant use wait so what do i use?
I was told set_task would do the job, but i dont know how to use that ...
Ideally this should work out so it show red(for 1 sec), white(for 1 sec), and blue(for 1 sec) then the hole thing disapears.
(Yes i do know this will be on top of each other.)

Code:
public client_connect(id) {     new dyAuthID[32], dyUserIP[32], dyUserName[32]     get_user_authid(id, dyAuthID, 31)     get_user_ip(id, dyUserIP, 31, 1)     get_user_name(id, dyUserName, 31)     if(get_user_flags(id)&ADMIN_ADMIN){         server_cmd("tsay 255000000 [ADMIN]%s has joined the server;wait;wait;wait;wait", dyUserName)         server_cmd("tsay 255255255 [ADMIN]%s has joined the server;wait;wait;wait;wait", dyUserName)         server_cmd("tsay 000000255 [ADMIN]%s has joined the server;wait;wait;wait;wait", dyUserName)     }else{         server_cmd("tsay 255255000 %s has joined the server", dyUserName)     } }

Bad HAL 9000 07-06-2004 15:49

I dont suggest using a existing command "tsay" I suggest building a whole new message command. doing it that way would not work, because it would print 3 lines 3 different colors, because standard tsay scrolls down when it prints a new message.

Dygear 07-06-2004 15:50

.......... I does ..........
I have not seen that

Bad HAL 9000 07-06-2004 15:54

I think it does, I cant remember if I added that or it was default lol.

Well, it would look SOMTHING like this

untested, I think it will work, maybe not. Also, dont use client_connect
use client_putinserver Well, you dont have to but it is called later on so there is a chance you can see your own welcome message
Code:
/* AMX Mod script. * * (c) 2003, Bad HAL 9000 * This file is provided as is (no warranties). */ #include <amxmodx> new dyAuthID[32], dyUserIP[32], dyUserName[32] public plugin_init(){     register_plugin("HAX","1.0","Bad HAL 9000") } public client_putinserver(id) {         get_user_authid(id, dyAuthID, 31)     get_user_ip(id, dyUserIP, 31, 1)     get_user_name(id, dyUserName, 31)     if(get_user_flags(id)&ADMIN_ADMIN){     set_task(15.0, "display_red", 110)     }else{         server_cmd("amx_tsay yellow %s has joined the server", dyUserName)     } } public display_red() {     server_cmd("amx_tsay red [ADMIN]%s has joined the server", dyUserName)     set_task(1.0, "display_green", 111)     remove_task(110) } public display_green() {     server_cmd("amx_tsay green [ADMIN]%s has joined the server", dyUserName)     set_task(1.0, "display_blue", 112)     remove_task(111) } public display_blue() {     server_cmd("amx_tsay blue [ADMIN]%s has joined the server", dyUserName)     remove_task(112) }

FroXeN 07-06-2004 16:44

8) nice work hal


All times are GMT -4. The time now is 14:52.

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