String - 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: String (
/showthread.php?tid=622537)
String -
Micko123 - 23.11.2016
I am optimizing one GM and I want to ask you this guys.. Lets say I need to format string 2 times. String should be 50 letters. Show I do this
PHP код:
new string[50], string2[50];
Or I can declare only one new with 50 and I can use it more than 1 time??
Re: String -
oMa37 - 23.11.2016
Use only one.
Re: String - Jelly23 - 23.11.2016
Quote:
Originally Posted by Micko123
I am optimizing one GM and I want to ask you this guys.. Lets say I need to format string 2 times. String should be 50 letters. Show I do this
PHP код:
new string[50], string2[50];
Or I can declare only one new with 50 and I can use it more than 1 time??
|
You can use the same more than one time.
Ex:
PHP код:
new somestring[4]; //Your string
format(somestring,sizeof(somestring),"%i",GetPlayerSkin(playerid)); //Gets your skin ID
SendClientMessage(playerid,-1,somestring); //Sends the message
format(somestring,sizeof(somestring),"%i",GetPlayerInterior(playerid)); //Gets your interior ID
SendClientMessage(playerid,-1,somestring); //Sends the message
Re: String -
SickAttack - 23.11.2016
Use two if you need different amount of cells, or if you need both values at the same time.
Re: String -
Micko123 - 24.11.2016
Thank you guys