A way to replace a whole name - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: A way to replace a whole name (
/showthread.php?tid=303222)
A way to replace a whole name -
oliverrud - 12.12.2011
I'm looking for some guidance regarding replacing example: "Test Test" with "Set Blah"
Like finding the Test Test and then replacing it with whatever I want.
Is there a function built for that?
Re: A way to replace a whole name -
THE_KNOWN - 12.12.2011
wiki.sa-mp.com/wiki/SetPlayerName ?
Re: A way to replace a whole name -
oliverrud - 12.12.2011
Nope, I'm not looking to change a players name I'm looking to change a string, sorry I didn't state that.
Its a string with maybe 120 characters, it could be, where I then would search for a phrase, and want to replace it.
Re: A way to replace a whole name -
THE_KNOWN - 12.12.2011
use
https://sampwiki.blast.hk/wiki/Strfind to get the offset,
then use strdel to delete the word(use its length)
then use strins to insert ur word in middle
Re: A way to replace a whole name -
KoczkaHUN - 12.12.2011
str_replace
http://forum.sa-mp.com/showpost.php?...postcount=2106