is it possible to direct change a float to a string?
#3

Код:
CMD:createbiz(playerid, params[])
{
	new tmp[30], tmp2[256], index;
	tmp = strtok(params, index);
	tmp2 = strtok(params, index);
	if(isnull(tmp)) return SendClientMessage(playerid, 0xFF00AA, "Usage: /createbiz [NAME (no spaces)] [price]");
	if(isnull(tmp2)) return SendClientMessage(playerid, 0xFF00AA, "Usage: /createbiz [NAME (no spaces)] [price]");
	new mprice = strval(tmp2);

	new File:ftw=fopen(BUSINESS_FILE_PATH, io_append);
	if(ftw)
        {
		new mytext[256], plstring[256];
		new Float:mx, Float:my, Float:mz;
		GetPlayerPos(playerid, mx,my,mz);
		new mworld = GetPlayerVirtualWorld(playerid);
		new into = GetPlayerInterior(playerid);
		new string[25];
		strcat(plstring, "You have added biz: ");
                strcat(mytext, tmp);
                strcat(mytext, ", ");
		strcat(mytext, tmp2);
		strcat(mytext, ", ");
		valstr(string, mx);
                strcat(mytext, string);
		strcat(mytext, ", ");
		valstr(string, my);
		strcat(mytext, string);
		strcat(mytext, ", ");
		valstr(string, mz);
		strcat(mytext, string);
		strcat(mytext, ", ");
		strcat(mytext, mworld);
		strcat(mytext, ", ");
		strcat(mytext, into);
                strcat(plstring, mytext);
		SendClientMessageToAll(0xFFFFFFFF,plstring);
		new mystring[30];
		format(mystring, 30, "%s\r\n", mytext);
		fwrite(ftw, mystring);
		fclose(ftw);
		return 1;
	}
	return 1;
}
No it is all my valstr. The values of them is a float, but valstr convert integers to strings.
I am looking after a funktion that work directly oppesit as Floatstr.
I just made it, and now i try fix it sooo...
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)