AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I could never get this :( (https://forums.alliedmods.net/showthread.php?t=17267)

pdoubleopdawg 08-28-2005 13:39

I could never get this :(
 
This gives me a random tint, even when providing the arguments.

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("TintMod","Alpha 0.1","DahVid")     register_clcmd("amx_tint","tint_cmd") } public tint_cmd(id)     {     new player[33]     read_argv(1,player,32)     new target=cmd_target(id,player,9)             new mode[4],holdtime[4],red[4],green[4],blue[4],alpha[4]         read_argv(2,mode,4)     read_argv(3,holdtime,4)     read_argv(4,red,4)     read_argv(5,green,4)     read_argv(6,blue,4)     read_argv(7,alpha,4)     tint_user(id,mode,holdtime,red,green,blue,alpha) } public tint_user(id,mode,holdtime,red,green,blue,alpha)     {     if(is_user_alive(id) && is_user_connected(id)) {         message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},target)         write_short(25)         write_short(holdtime)         write_short(mode)         write_byte(red)         write_byte(green)         write_byte(blue)         write_byte(alpha)         message_end()     } }

knekter 08-28-2005 13:46

there stored as strings right now:
Code:
tint_user(id,str_to_num(mode),str_to_num(holdtime),str_to_num(red),str_to_num(green),str_to_num(blue),str_to_num(alpha))

XxAvalanchexX 08-28-2005 14:23

Also, you declare your string arrays with a size of 4 and also fill up all 4 slots with read_argv, not sparing a slot for the string terminator.

pdoubleopdawg 08-28-2005 14:55

Thanks, I'll give it a go.


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

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