Advertisement
S4T3K

strrep

May 7th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.54 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. public OnFilterScriptInit()
  4. {
  5.     new string[] = "Coucou Kilou le boss de la street'zer";
  6.     printf(string);
  7.     strrep(string, "Kilou", "S4T3K");
  8.     printf(string);
  9.     return 1;
  10. }
  11.  
  12. stock strrep(str[], const oldsub[], const newsub[])
  13. {
  14.     if(!strfind(str, oldsub)) return -1;
  15.     new pos[2];
  16.     pos[0] = strfind(str, oldsub);
  17.     pos[1] = strfind(str, " ", true, pos[0]);
  18.     strdel(str, pos[0], pos[1]);
  19.     strins(str, newsub, pos[0]);
  20.     return 1;
  21. }
  22.  
  23. native strrep(str[], const oldsub[], const newsub[]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement