SA-MP Forums Archive
Strmid or Strcat or Strins? - 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: Strmid or Strcat or Strins? (/showthread.php?tid=398377)



Strmid or Strcat or Strins? - scott1 - 09.12.2012

Hi all,

hi would like to know the best way to make log dialog.

Usualy i use strins

Код:
strins(menu,"\n\nblabla1", strlen(menu));
strins(menu,"\n\nblabla2", strlen(menu));
strins(menu,"\n\nblabla3", strlen(menu));
or will it better to use another way?

Same question

when i want to define payer string when the connect i use

something like this

Код:
strmid(PlayerCrimes[playerid][pkiller], "Unknow", 0, 32, 32);
will it better to use another way ?

Thank You

Max


Re: Strmid or Strcat or Strins? - GWMPT - 09.12.2012

The strcat just put 2 strings / ints / floats / whatever on the same variable.

So, you could use strcat for the menu.

And for the player info, you can normally define the variable content without strins, strcat or anything else.


Re: Strmid or Strcat or Strins? - Konstantinos - 09.12.2012

I've heard that using strmid is faster than the simple format
pawn Код:
format( PlayerCrimes[ playerid ][ pkiller ], sizeof( PlayerCrimes[ playerid ][ pkiller ] ), "Unknow" );
About the first, in case you don't want to use "\" character, I'd go with strcat.


Re: Strmid or Strcat or Strins? - Vince - 09.12.2012

Yes, format is slow. However;
pawn Код:
PlayerCrimes[playerid][pkiller] = "Unknown";
Should also work just fine.


Re : Strmid or Strcat or Strins? - scott1 - 09.12.2012

Ok thank you.

So i could use strcat

Max