strings problem
#1

always worked, but now somes happend and not work.
Код:
CMD:gethomepos(playerid, cmdtext[])
{
	if(IsPlayerAdmin(playerid))
	{
		new Float:x, Float:y, Float:z;
		new Float:angle;
		new string[128];
		new string2[128];
		new string3[128];

		GetPlayerPos(playerid, x, y, z);
		GetPlayerFacingAngle(playerid, angle);
		format(string, sizeof(string), "x: %f, y: %f, z: %f, angle: %f", x, y, z, angle);
		SendClientMessage(playerid, -1, string);

		format(string2, sizeof(string2), "IsPlayerInRangeOfPoint(playerid, 1.0, %f, %f, %f);", x, y, z);
		format(string3, sizeof(string3), "SetPlayerFacingAngle(playerid, %f);", angle);
		printf(string2);
		printf(string3);

	}

	return 1;
}
Reply
#2

Try using %2.f instead of %f
Reply
#3

still, nothing happens
Reply
#4

format(string, sizeof(string), "x: %1f, y: %1f, z: %1f, angle: %1f", x, y, z, angle);
try this ^
Reply
#5

Why are you formatting a string to print, when printf do everything?
Reply
#6

nothing :<

EDIT:
@up, changed for printf, but still it not work
Код:
CMD:gethomepos(playerid, cmdtext[])
{
	if(IsPlayerAdmin(playerid))
	{
		new Float:x, Float:y, Float:z;
		new Float:angle;
		new string[128];

		GetPlayerPos(playerid, x, y, z);
		GetPlayerFacingAngle(playerid, angle);
		format(string, sizeof(string), "x: %1f, y: %1f, z: %1f, angle: %1f", x, y, z, angle);
		SendClientMessage(playerid, -1, string);

		printf("IsPlayerInRangeOfPoint(playerid, 1.0, %f, %f, %f);", x, y, z);
		printf("SetPlayerFacingAngle(playerid, %f);", angle);

	}

	return 1;
}
Reply
#7

You must be logged as Rcon Admin
Reply
#8

damnit, my stupid fault.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)