AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Iconstatus (dude + need help) (https://forums.alliedmods.net/showthread.php?t=183028)

bazhenov93 04-16-2012 08:05

Iconstatus (dude + need help)
 
Currently I use in this way to display icons:
PHP Code:

message_begin(MSG_ONE_UNRELIABLE,iconstatus,{0,0,0},id);
write_byte(1); // status (0=hide, 1=show, 2=flash)
write_string("dmg_shock"); // sprite name
write_byte(37); // red
write_byte(164); // green
write_byte(249); // blue
message_end();
                
message_begin(MSG_ONE_UNRELIABLE,iconstatus,{0,0,0},id);
write_byte(1); // status (0=hide, 1=show, 2=flash)
write_string("item_battery"); // sprite name
write_byte(37); // red
write_byte(164); // green
write_byte(249); // blue
message_end(); 

Is better MSG_ONE or MSG_ONE_UNRELIABLE?

How to use write_string with more items in one file?
ex: Code:
new files { "buy_zone", "item_battery", "another_icon" } write_string("files");


Also I have a menu, when is opened:
Code:
write_byte(0); // status (0=hide, 1=show, 2=flash) write_string("buy_zone"); // sprite name


and when is closed:
Code:
write_byte(1); // status (0=hide, 1=show, 2=flash) write_string("buy_zone"); // sprite name


What's is the best way and better coded?

bazhenov93 05-13-2012 14:35

Re: Iconstatus (dude + need help)
 
bump

<VeCo> 05-13-2012 15:01

Re: Iconstatus (dude + need help)
 
Use MSG_ONE_UNRELIABLE.
For the other questions - I don't understand you.

mottzi 05-13-2012 17:02

Re: Iconstatus (dude + need help)
 
Quote:

Originally Posted by bazhenov93 (Post 1690335)
How to use write_string with more items in one file?
ex: Code:
new files { "buy_zone", "item_battery", "another_icon" } write_string("files");

Use a for loop.


All times are GMT -4. The time now is 07:54.

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