Raised This Month: $ Target: $400
 0% 

formatex & random


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-08-2013 , 03:39   formatex & random
Reply With Quote #1

Hello! I have a code:

PHP Code:
...for (new 0; ....
{
      new 
message[350]
      
formatex(message349,"<tr><td align='center'>%2d</td><td align='center'>%-22.22s</td><td align='center'>%6d</td>... other code")
      
write_file(tmp_file,message)
}
.... 
This code writes a rows in a file:
Quote:
<tr><td align='center'>%2d</td><td align='center'>%-22.22s</td><td align='center'>%6d</td>... other code
<tr><td align='center'>%2d</td><td align='center'>%-22.22s</td><td align='center'>%6d</td>... other code
<tr><td align='center'>%2d</td><td align='center'>%-22.22s</td><td align='center'>%6d</td>... other code
<tr><td align='center'>%2d</td><td align='center'>%-22.22s</td><td align='center'>%6d</td>... other code
etc.
may i change formatex so that one param in each row will alternate (successively, not random)? for example:

Quote:
<tr><td align='center'>%2d</td><td align='center'>%-22.22s</td><td align='center'>%6d</td>... other code
<tr><td align='left'>%2d</td><td align='center'>%-22.22s</td><td align='center'>%6d</td>... other code
<tr><td align='center'>%2d</td><td align='center'>%-22.22s</td><td align='center'>%6d</td>... other code
<tr><td align='left'>%2d</td><td align='center'>%-22.22s</td><td align='center'>%6d</td>... other code
<tr><td align='center'>%2d</td><td align='center'>%-22.22s</td><td align='center'>%6d</td>... other code
<tr><td align='left'>%2d</td><td align='center'>%-22.22s</td><td align='center'>%6d</td>... other code
etc.
PHP Code:
...for (new 0; ....
{
      new 
message[350]
      
/*1*/ formatex(message349,"<tr><td  align='CENTER'>%2d</td><td  align='center'>%-22.22s</td><td  align='center'>%6d</td>... other code")
      
/*2*/ formatex(message349,"<tr><td  align='LEFT'>%2d</td><td  align='center'>%-22.22s</td><td  align='center'>%6d</td>... other code")
      
/*in each cycle will be used only one formatex successively*/ 
      
write_file(tmp_file,message)
}
.... 
__________________
sorry my bad english...

Last edited by alonelive; 06-08-2013 at 03:48.
alonelive is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-08-2013 , 03:40   Re: formatex & random
Reply With Quote #2

Your question is .. ?
__________________
Arkshine is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-08-2013 , 03:58   Re: formatex & random
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
Your question is .. ?
reload page please (topic has been changed).
__________________
sorry my bad english...

Last edited by alonelive; 06-08-2013 at 03:59.
alonelive is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-08-2013 , 04:38   Re: formatex & random
Reply With Quote #4

solved with pseudoclasses css.
__________________
sorry my bad english...
alonelive is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-08-2013 , 05:09   Re: formatex & random
Reply With Quote #5

Fuck! hl motd does not support pseudoclasses css.. thread is actual..

solved with : https://forums.alliedmods.net/showthread.php?t=76838
__________________
sorry my bad english...

Last edited by alonelive; 06-08-2013 at 05:30.
alonelive is offline
Reply



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 16:22.


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