[Help] Calling function via string
#1

How can I call function via string.

I have "xyz" saved at file like "xyz = 55.446,4244.4148,49974.54554", how i can call it in some function (Like SetPlayerPos)

Here is some examples;

Code:
string_with_this_floats = "55.446,4244.4148,49974.54554";
format(string,128,"%s",string_with_this_floats);
CallSomeFunction("SetPlayerPos", "fff",string);
or

Code:
string_with_this_floats = "55.446,4244.4148,49974.54554";
format(string,128,SetPlayerPos(playerid,%s),string_with_this_floats);
CallSomeFunction(string);
Or any way, just help
Reply
#2

Try with Sscanf + strfloat, or simply save x = posX, another line: y = posY, another line: z = posZ and SetPlayerPos( playerid, SetPlayerPos( playerid, dini_Float( file, "x" ), dini_Float( file, "y" ), dini_Float( file, "z" ) ); or with what writing system do you use.
Reply
#3

sscanf + strfloat is good combination, I'm totally forgot of sscanf, ty very much...

Lock
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)