String
#1

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??
Reply
#2

Use only one.
Reply
#3

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 
Reply
#4

Use two if you need different amount of cells, or if you need both values at the same time.
Reply
#5

Thank you guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)