strings problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: strings problem (
/showthread.php?tid=525340)
strings problem -
cnoopers - 11.07.2014
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;
}
Re: strings problem - Guest4390857394857 - 11.07.2014
Try using %2.f instead of %f
Re: strings problem -
cnoopers - 11.07.2014
still, nothing happens
Re: strings problem -
BroZeus - 11.07.2014
format(string, sizeof(string), "x: %1f, y: %1f, z: %1f, angle: %1f", x, y, z, angle);
try this ^
Re: strings problem -
GWMPT - 11.07.2014
Why are you formatting a string to print, when printf do everything?
Re: strings problem -
cnoopers - 11.07.2014
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;
}
Re: strings problem -
Jefff - 11.07.2014
You must be logged as Rcon Admin
Re: strings problem -
cnoopers - 11.07.2014
damnit, my stupid fault.