GetPlayerPos returns 0.0, 0.0, 0.0 - 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: GetPlayerPos returns 0.0, 0.0, 0.0 (
/showthread.php?tid=664925)
GetPlayerPos returns 0.0, 0.0, 0.0 -
Hreesang - 16.03.2019
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?
Re: GetPlayerPos returns 0.0, 0.0, 0.0 -
antixgaming - 16.03.2019
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.
Re: GetPlayerPos returns 0.0, 0.0, 0.0 -
Hreesang - 16.03.2019
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.