Raised This Month: $ Target: $400
 0% 

Add some points on a Integer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-11-2010 , 13:49   Re: Add some points on a Integer
Reply With Quote #1

Code:
InsertCharacter( szInput[], iLoc, iChar, szOutput[], iLen )
{
    copy(szOutput, iLen, szInput);
    if( iLoc < iLen )
    {
        szOutput[iLoc] = iChar;
        copy(szOutput[iLoc+1], iLen-(iLoc+1), szInput[iLoc]);
    }
}
Untested. Usage:
Code:
InsertCharacter( "12345", 2, '.', blah, charsmax(blah));
// blah == "12.345"

Last edited by Emp`; 03-11-2010 at 13:52.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 03-11-2010 , 13:58   Re: Add some points on a Integer
Reply With Quote #2

Quote:
Originally Posted by worldspawn View Post
sorry for offtop but what for?
Why i must tell you? o.O

Quote:
Originally Posted by Emp` View Post
Code:
InsertCharacter( szInput[], iLoc, iChar, szOutput[], iLen )
{
    copy(szOutput, iLen, szInput);
    if( iLoc < iLen )
    {
        szOutput[iLoc] = iChar;
        copy(szOutput[iLoc+1], iLen-(iLoc+1), szInput[iLoc]);
    }
}
Untested. Usage:
Code:
InsertCharacter( "12345", 2, '.', blah, charsmax(blah));
// blah == "12.345"
What is the usage of the second parameter?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS 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 19:49.


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