Raised This Month: $ Target: $400
 0% 

removing letter from begining of string


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 01-22-2009 , 02:15   Re: removing letter from begining of string
Reply With Quote #1

this is what i have and i hope u can make it so that every 5 seconds it will remove the first letter cause im limited to a certain amount of text in status text so i want it to be nice and smooth like its scrolling if needed u can remove 5 at a time what ever u prefer
Code:
new iLen = strlen( szString ); 
if(iLen > 60)
     while(iLen != i+1 )
     {
          if( gametime-LastMessage[id] > 0.5 )
          {
               if( iLen - 2 != i )
               {
                    format( szStringer, 256, "%s" , szString[i]) 
                    Create_StatusText( id, 0, szStringer);
               }
               else
                    Create_StatusText( id, 0, szString);

 
               LastMessage[id] = gametime;
               i++
          }
     }
else
     Create_StatusText( id, 0, szString);

didnt do any changes yet hoping u can do it for me thanks alot
whosyourdaddy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-22-2009 , 11:31   Re: removing letter from begining of string
Reply With Quote #2

Quote:
Originally Posted by whosyourdaddy View Post
this is what i have and i hope u can make it so that every 5 seconds it will remove the first letter cause im limited to a certain amount of text in status text so i want it to be nice and smooth like its scrolling if needed u can remove 5 at a time what ever u prefer
Code:
new iLen = strlen( szString ); 
if(iLen > 60)
     while(iLen != i+1 )
     {
          if( gametime-LastMessage[id] > 0.5 )
          {
               if( iLen - 2 != i )
               {
                    format( szStringer, 256, "%s" , szString[i]) 
                    Create_StatusText( id, 0, szStringer);
               }
               else
                    Create_StatusText( id, 0, szString);

 
               LastMessage[id] = gametime;
               i++
          }
     }
else
     Create_StatusText( id, 0, szString);

didnt do any changes yet hoping u can do it for me thanks alot
What exactly are you trying to do though. Please be specific.
__________________
Bugsy is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-22-2009 , 12:16   Re: removing letter from begining of string
Reply With Quote #3

To remove the first character, just do this:
Code:
copy(string, sizeof(string) - 1, string[1]);
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 01-22-2009 , 15:25   Re: removing letter from begining of string
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
To remove the first character, just do this: Code:
copy(string, sizeof(string) - 1, string[1]);
as i said above... just that i answered his question how to remove the first 2 chars ^^

edit:
then you will need a task in which you always remove the char as exolent and i posted. for the "string > 60" you can use if(strlen(string) > 60) and then use the copy() native
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
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 01:41.


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