Posts: 8
Threads: 1
Joined: Jul 2013
Reputation:
0
18.11.2014, 20:28
(
Последний раз редактировалось Olymp2000; 19.11.2014 в 20:05.
)
How to return a string (in func it is a char array)
Posts: 8
Threads: 1
Joined: Jul 2013
Reputation:
0
18.11.2014, 20:38
(
Последний раз редактировалось Olymp2000; 19.11.2014 в 20:05.
)
How to return a string (in func it is a char array)
Posts: 987
Threads: 21
Joined: Nov 2012
Reputation:
0
Need help heh?
Then, please, write your topic in English, so we can assist you.
Posts: 8
Threads: 1
Joined: Jul 2013
Reputation:
0
How to return a string (in func it is a char array)
Posts: 290
Threads: 7
Joined: Dec 2013
You can only post in english here, update your topic.
Posts: 8
Threads: 1
Joined: Jul 2013
Reputation:
0
Done. Searching for help:How to return a string (in func it is a char array)
Posts: 8
Threads: 1
Joined: Jul 2013
Reputation:
0
Sry i am new but this was my first opinon but then the vector didnt bring anything cauz you hafe a buffer with a defined size but i want a direct return so at the end i can place it for ex in SendClientMessage
Posts: 4,878
Threads: 85
Joined: Jun 2007
Reputation:
0
Afaik a plugin native can only return a single pawn cell, I havent seen a plugin native with a true string return. Better just use the reference way, its better style anways. If you really need direct return you could still wrap it in a pawn function, just like people sometimes do for GetPlayerName.
Posts: 8
Threads: 1
Joined: Jul 2013
Reputation:
0
But then a char vector is never possible or ? Because you ever need a buffer which have a defined size
Posts: 4,878
Threads: 85
Joined: Jun 2007
Reputation:
0
At least in pawn it isnt possible, because after all youll always end up with a fixed-size array.
You can have a char vector in a plugin, but when returning it to pawn youll also have to write it into an array with fix size.
Posts: 8
Threads: 1
Joined: Jul 2013
Reputation:
0
How to wrap it without an array in pawn ?
Posts: 1,046
Threads: 29
Joined: Mar 2010
Strings (arrays) in PAWN are basicly references of 32 bit array objects, so you have to allocate that array in your plugin and return its reference.