Raised This Month: $12 Target: $400
 3% 

replace_stringex


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PartialCloning
Senior Member
Join Date: Dec 2015
Old 12-24-2015 , 12:26   replace_stringex
Reply With Quote #1

replace_stringex does not seem to be working for me. It just removes the search string it doesn't replace it with the replacement string.

I tried it with replace and replace_string and both worked, that's why I figured something is wrong with replace_stringex.

PHP Code:
public test(id)
{
    new 
test1[5] = "fool";
    new 
test2[5] = "fool";
    new 
test3[5] = "fool";

    
replace(test14"f""c");
    
client_print(idprint_chat"%s"test1);

    
replace_string(test24"f""t");
    
client_print(idprint_chat"%s"test2);

    
replace_stringex(test34"f""p");
    
client_print(idprint_chat"%s"test3);

Prints out:
PHP Code:
cool
tool
ool 

I checked string.ccp and found that replace_stringex does:
PHP Code:
set_amxstring(amxparams[1], ptrmaxlength); 
While with replace_string sets the text not ptr/count:
PHP Code:
set_amxstring(amxparams[1], textmaxlength); 
That might be because of how they work, I can't tell but I figured I'd mention it anyway.
PartialCloning is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-24-2015 , 12:47   Re: replace_stringex
Reply With Quote #2

Yep, it should be 'text'. Not sure how I did the typo. Thanks, will fix soon.

EDIT: Fixed (#327)
__________________

Last edited by Arkshine; 12-24-2015 at 17:13.
Arkshine 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 09:22.


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