AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   show_hudmessage 5 times but bring down the variables (https://forums.alliedmods.net/showthread.php?t=49557)

kp_uparrow 01-06-2007 22:46

show_hudmessage 5 times but bring down the variables
 
if i want to 1 hud message 5 times,:

Code:
set_task(1.0,"show_hudmessage2(0, ^"%s :   %s^", name, message[i + n])",id,"",0,"a",5)

but how do you bring down the variables thats stored in the "name" and "message[i+n]" in the called function?

Code:
What do i need to change to this:? public show_hudmessage2() {     show_hudmessage(0, "%s :   %s", name, message[i + n]) }
ask me if something is unclear

stupok 01-06-2007 23:06

Re: show_hudmessage 5 times but bring down the variables
 
I don't know exactly what you want to do, so here's an example: (untested)


Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "stupok69" #define MAX_MESSAGES 3 new message[MAX_MESSAGES][] = {     "lol this is the first message",     "rofl here's the second one",     "ok this is the last one" } new messagenum[33] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR) } public client_putinserver(id) {     messagenum[id] = 0     set_task(1.0, "hud_function", id, "", 0, "a", 3) } public hud_function(id) {     new name[32]     get_user_name(id, name, 31)         set_hudmessage(200, 100, 0, 0.0, 0.0, 0, 0.0, 2.0, 0.0, 0.0, -1)     show_hudmessage(0, "%s :   %s", name, message[messagenum[id]])         messagenum[id]++ }

kp_uparrow 01-06-2007 23:26

Re: show_hudmessage 5 times but bring down the variables
 
i mean the variable: name, message[] is stored in the function with the set_task, i need to transfer the variables in the function with the set_task to the function that the set_task calls


All times are GMT -4. The time now is 22:29.

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