Raised This Month: $ Target: $400
 0% 

Dynamic MOTD


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-28-2010 , 19:41   Re: Dynamic MOTD
Reply With Quote #31

Quote:
Originally Posted by drekes View Post
and if i make normal array like your example here
PHP Code:
new TheArray[] = "hello"//size = 6, 5 chars + 1 null 
and i want to change the "hello" to "bye" which is 1 character shorter than hello, i still don't have to define it when i created it? and i want to check the y i do
PHP Code:
if(ACH[1] == y
You can do this two ways.

Using a function (copy\formatex\etc):
PHP Code:
new TheArray[] = "hello";

copyTheArray charsmaxTheArray ) , "bye" ); 
Or manually:
PHP Code:
new TheArray[] = "hello";

TheArray] = 'b';
TheArray] = 'y';
TheArray] = 'e';
TheArray] = EOS
Just keep in mind, you cannot store more than 5 characters in TheArray since it is declared holding 'hello' which limits it to 5 characters as a string or a 6 number array.
__________________

Last edited by Bugsy; 04-28-2010 at 19:44.
Bugsy is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 04-28-2010 , 19:42   Re: Dynamic MOTD
Reply With Quote #32

Okay, now i'm sure i found the point again.
Thanks guys

About the 2 characters: I'm really not that good in counting stuff, it's because of the double "L" i missed it.

EDIT: i'm not completly sure, but regarding to your earlier post, i guess "EOS" is a null character, right?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 04-28-2010 , 19:44   Re: Dynamic MOTD
Reply With Quote #33

@Bugsy - Even though I probably won't ever be using this, is EOS really the null terminator for a string?
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-28-2010 , 19:46   Re: Dynamic MOTD
Reply With Quote #34

Quote:
Originally Posted by wrecked_ View Post
@Bugsy - Even though I probably won't ever be using this, is EOS really the null terminator for a string?
Yes.

Pawn language guide:
Code:
EOS: predefined constant standing for End Of String; it has the value ’\0’
__________________
Bugsy is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 04-28-2010 , 19:47   Re: Dynamic MOTD
Reply With Quote #35

Quote:
Originally Posted by Bugsy View Post
Yes.

Pawn language guide:
Code:
EOS: predefined constant standing for End Of String; it has the value ’\0’
Ah, yeah. I got confused because I was familiar with \0 being the common null terminator.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 04-28-2010 , 19:47   Re: Dynamic MOTD
Reply With Quote #36

Thanks.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 00:13.


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