Raised This Month: $ Target: $400
 0% 

Making str_to_num cycle in client_PostThink


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Stephen
Senior Member
Join Date: Aug 2004
Old 04-25-2006 , 09:18   Making str_to_num cycle in client_PostThink
Reply With Quote #1

Code:
public client_PostThink(id) {     if (FxArray[id]==1)     {     new scale[12], brightness[12]     read_argv(1, scale, 11)     read_argv(2, brightness, 11)     new origin[3];     get_user_origin(id,origin);     message_begin(MSG_BROADCAST,SVC_TEMPENTITY);     write_byte(TE_SPRITE);     write_coord(origin[0]);     write_coord(origin[0] -= 1);     write_coord(origin[0] += 1);     write_short(sprite); // short (sprite index)     write_byte(str_to_num(scale)); // byte (scale in 0.1's)       write_byte(str_to_num(brightness)); // byte (brightness)     message_end();          }     else if (FxArray[id]==0)     {     }     return PLUGIN_CONTINUE }

When i set the scale and brightness right into the plugin it works.
But when i wanna use the code with str_to_num it only plays 1 cycle and then it dissapears again.

While this snippet works but not customaizable via the ingame console.
Code:
public client_PostThink(id) {     if (FxArray[id]==1)     {     new origin[3];     get_user_origin(id,origin);     message_begin(MSG_BROADCAST,SVC_TEMPENTITY);     write_byte(TE_SPRITE);     write_coord(origin[0]);     write_coord(origin[0] -= 1);     write_coord(origin[0] += 1);     write_short(sprite); // short (sprite index)     write_byte(6); // byte (scale in 0.1's)       write_byte(111); // byte (brightness)     message_end();          }     else if (FxArray[id]==0)     {     }     return PLUGIN_CONTINUE }

So HOW do i make it so i can use str_to_num in the snippet without vanishing after 1 cycle ?
__________________
www.corona-bytes.net (ECX = ESF Addon)
Stephen is offline
 


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 05:02.


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