Raised This Month: $ Target: $400
 0% 

I could never get this :(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 08-28-2005 , 13:39   I could never get this :(
Reply With Quote #1

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()     } }
pdoubleopdawg is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 08-28-2005 , 13:46  
Reply With Quote #2

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))
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-28-2005 , 14:23  
Reply With Quote #3

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.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 08-28-2005 , 14:55  
Reply With Quote #4

Thanks, I'll give it a go.
pdoubleopdawg is offline
Reply


Thread Tools
Display Modes

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 14:19.


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