public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/pos", true) == 0)
{
new Float:x, Float:y, Float:z, string[50];
GetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "x: %f, y: %f, z: %f", x, y, z);
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
return 1;
}
|
i'm trying to tell player's pos in the chat but it retrieves empty floats
any idia why this doesn't work? Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/pos", true, 4) == 0)
{
new Float:x, Float:y, Float:z, string[50];
GetPlayerPos(playerid, x, y, z);
format(string, sizeof(string), "x: %f, y: %f, z: %f", x, y, z);
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
return 1;
}
|
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/pos", true) == 0)
{
new Float:x, Float:y, Float:z, string[50];
GetPlayerPos(playerid, x, y, z);
printf("x:%f, y:%f, z:%f", x, y, z);
format(string, sizeof(string), "x: %f, y: %f, z: %f", x, y, z);
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
return 1;
}
x: 1.11111111, y: 1.11111111, z: 1.11111111
x: 1.11111111, y: 1.11111111, z: 1.11111111
x: 1.11111111, y: 1.11111
|
wired works for me!
No! 50 is enough theres no need for 256! this req 44 cells Код:
x: 1.11111111, y: 1.11111111, z: 1.11111111 for example instead off Код:
x: 1.11111111, y: 1.11111111, z: 1.11111111 Код:
x: 1.11111111, y: 1.11111 |
|
i'm using a similar variable on a filterscript that was the problem, i removed temporarily the filterscript and it worked, thanks, i'm so stupid for creating a thread just for this
|