GetPlayerPos returns 0.0, 0.0, 0.0
#1

I don't know why did this happened, my whole scripts worked properly, but I don't know why this one did not work:
Код:
CMD:create_street(playerid, params[])
{
	new Float: player_pos[3];
	if(player_temp[playerid][in_action])
	{
	    if(sscanf(params,"s[32]", params[0]))
		{
			return SendClientMessage(playerid, -1, "USAGE: /create_street [street_name]");
		}
		GetPlayerPos(playerid, player_pos[0], player_pos[1], player_pos[2]);
		player_temp[playerid][current_pos][3] = player_pos[0];
		player_temp[playerid][current_pos][4] = player_pos[1];
		player_temp[playerid][current_pos][5] = player_pos[2];
		format(player_temp[playerid][static_string], params[0]);
		generate_street(playerid, 0);
	}
	else
	{
		GetPlayerPos(playerid, player_pos[0], player_pos[1], player_pos[2]);
		player_temp[playerid][current_pos][0] = player_pos[0];
		player_temp[playerid][current_pos][1] = player_pos[1];
		player_temp[playerid][current_pos][2] = player_pos[2];
		player_temp[playerid][in_action] = true;
		SendClientMessage(playerid, -1, "SERVER: Please stand at any corner or the end of street.");
		SendClientMessage(playerid, -1, "SERVER: Take more 10 sprints after redo the command.");
	}
	return true;
}
The GetPlayerPos returns 0.0, 0.0, 0.0.
I'm using this filterscript.

Could somebody tell me why?
Reply
#2

You are missing some arguments in format. I cannot understand what you or your script meant there. If you used someone's else filterscript, try to contact that person and tell him your problem.
Reply
#3

I know the 'format' was the wrong argument, but my point is not that. I just dont know why the GetPlayerPos returns 0.0.

Edit: I fixed the problem, the enum variable of 'static_string' was an integer which it should be a string, so I changed it on the enumerator.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)