SA-MP Forums Archive
Error SetPlayerPos - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error SetPlayerPos (/showthread.php?tid=124440)



Error SetPlayerPos - Zafire2008 - 30.01.2010

I am using this code for telepor player but give me this error

Код:
C:\Documents and Settings\Administrador\Mis documentos\Evolution Roleplay\gamemodes\evolution.pwn(599) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Here is my code

Код:
	 	new pos_x[128];
	 	new pos_y[128];
	 	new pos_z[128];
		SetPlayerSkin(playerid, pinfo[playerid][skin]);
		format(pos_x, sizeof(pos_x), "%f", pinfo[playerid][px]);
		format(pos_y, sizeof(pos_y), "%f", pinfo[playerid][py]);
		format(pos_z, sizeof(pos_z), "%f", pinfo[playerid][pz]);
		SetPlayerPos(playerid,pos_x,pos_y,pos_z);
 		ResetPlayerMoney(playerid);
		SafeGivePlayerMoney(playerid, pinfo[playerid][dinero]);
This is the line number 599

SetPlayerPos(playerid,pos_x,pos_y,pos_z);


Re: Error SetPlayerPos - DeathOnaStick - 30.01.2010

It gives an error, because you use a string as a value, instead of a float. Don't use format for that. Do something like this:
pawn Код:
new Float:pos_x, Float: pos_y, Float:pos_z;
pos_x=pinfo[playerid][px];
pos_y=pinfo[playerid][py];
pos_z=pinfo[playerid][pz];



Re: Error SetPlayerPos - Zafire2008 - 30.01.2010

Thxx i use that but my game crashes again and give me another location.. i have used a loooot of different codes and my game crashes this error is making me crazy

[img width=960 height=768]/imageshack/img52/1936/errorsamp.jpg[/img]


Re: Error SetPlayerPos - Zafire2008 - 30.01.2010

here is my code :S

Код:
	 	new qr[128];
		new Float:pos_x, Float: pos_y, Float:pos_z;
		pos_x=pinfo[playerid][px];
		pos_y=pinfo[playerid][py];
		pos_z=pinfo[playerid][pz];
		format(qr, sizeof(qr), "UPDATE `evo`.`jugadores` SET `Spawned` = '1' WHERE `jugadores`.`nombre` ='%s' LIMIT 1", pname);
		SetPlayerSkin(playerid, pinfo[playerid][skin]);
		SetPlayerPos(playerid, pos_x, pos_y, pos_z);
 		ResetPlayerMoney(playerid);
		SafeGivePlayerMoney(playerid, pinfo[playerid][dinero]);



Re: Error SetPlayerPos - Zafire2008 - 30.01.2010

Quote:
Originally Posted by Seif_
That's because the location is too far.
I dont understand you... the location is too far?.. the location is correct i used format and sendclientmessage for said me the coords and they are corrects... :S... the last location i saved whas in lv airport


Re: Error SetPlayerPos - Zafire2008 - 30.01.2010

Here is an example of my saved coords

x: 1928.707031 y: 465.787597 z: 2.510151

i used this code for save the player coords

Код:
public GuardarPos(playerid)
{
	new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
	new qry[256];
	new pname[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pname, sizeof(pname));
	printf("%i cambio su posicion: x: %f y: %f z: %f",playerid, x, y, z);
 	format(qry, sizeof(qry), "UPDATE `evo`.`jugadores` SET `Px` = '%f', `Py` = '%f', `Pz` = '%f' WHERE `jugadores`.`Nombre` ='%s' LIMIT 1", x, y, z, pname);
 	mysql_query(qry);
}



Re: Error SetPlayerPos - ray187 - 30.01.2010

Maybe you don`t assign the coordinates as you should to pinfo[playerid][p..]


Re: Error SetPlayerPos - Zafire2008 - 30.01.2010

Quote:
Originally Posted by ray187
Maybe you don`t assign the coordinates as you should to pinfo[playerid][p..]
i assign the corrects coordinates.. because i use Format and SendClientMessage.. for showme the coordinatdes in game.. and there are the corrects coordinates..

T_T that error isss making me crazy xD


Re: Error SetPlayerPos - MadeMan - 30.01.2010

Tried showing the coords just before spawning?


Re: Error SetPlayerPos - Zafire2008 - 30.01.2010

Quote:
Originally Posted by MadeMan
Tried showing the coords just before spawning?
i make that and show me the corrects coords.. i think maybe is a bug of samp 0.3