Raised This Month: $ Target: $400
 0% 

Solved Replacing a SayText message with arguments


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-02-2017 , 09:50   Re: Replacing a SayText message with arguments
Reply With Quote #7

Oh, I actually came up with an automized way to do this using a simple loop:

PHP Code:
public msgTextMsg(iMessageiDestid)

    static 
szMessage[64]
    
get_msg_arg_string(2szMessagecharsmax(szMessage))
    
    if(
TrieKeyExists(g_eTries[TRIE_MESSAGES], szMessage))
    {
        new 
szNewMessage[128], iType
        TrieGetString
(g_eTries[TRIE_MESSAGES], szMessageszNewMessagecharsmax(szNewMessage))
        
TrieGetCell(g_eTries[TRIE_TYPE], szMessageiType)
        
        new 
iArgs get_msg_args()
        
        if(
iArgs 2)
        {
            for(new 
szSubString[32], 2iArgsi++)
            {
                
get_msg_arg_string(1szSubStringcharsmax(szSubString))
                
replace(szNewMessagecharsmax(szNewMessage), SYM_SUBSTRINGszSubString)
            }
        }
        
        
replace_all(szNewMessagecharsmax(szNewMessage), SYM_SUBSTRING"")

        ... 
send message 
Thanks for pointing me in the right direction.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
 



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 21:03.


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