Help with GetPlayerPos - 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: Help with GetPlayerPos (
/showthread.php?tid=200232)
Help with GetPlayerPos -
matute - 17.12.2010
Hello people, i was making a gamemode, and at OnPlayerSpawn i wrote
pawn Code:
switch(gClass[playerid])
{
case 0:
{
SetPlayerColor(playerid, 0x004080FF);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
new Float:angle;
PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
PlayerInfo[playerid][pModel] = 0;
PlayerInfo[playerid][pPos_x] = x;
PlayerInfo[playerid][pPos_y] = y;
PlayerInfo[playerid][pPos_z] = z;
PlayerInfo[playerid][pPos_r] = GetPlayerFacingAngle(playerid, angle);
PlayerInfo[playerid][pWeapon1] = GetPlayerWeaponData(playerid, 1, weaponid, ammo);
PlayerInfo[playerid][pWeapon2] = GetPlayerWeaponData(playerid, 2, weaponid, ammo);
PlayerInfo[playerid][pWeapon3] = GetPlayerWeaponData(playerid, 3, weaponid, ammo);
return 1;
}
}
return 1;
}
And i get a warning at
pawn Code:
PlayerInfo[playerid][pPos_x] = x;
PlayerInfo[playerid][pPos_y] = y;
PlayerInfo[playerid][pPos_z] = z;
And It says: warning 213: tag mismatch
Please can you help me guys
thanks you
Re: Help with GetPlayerPos -
Biesmen - 17.12.2010
Did you define pPos_X, pPos_y, pPos_z as a float?
Re: Help with GetPlayerPos -
matute - 17.12.2010
Quote:
Originally Posted by Biesmen
Did you define pPos_X, pPos_y, pPos_z as a float?
|
yes, i defined them as floats
Re: Help with GetPlayerPos -
yvoms - 17.12.2010
Biesmen is right.
Did you define them as a float?
Re: Help with GetPlayerPos -
matute - 17.12.2010
Quote:
Originally Posted by yvoms
Biesmen is right.
Did you define them as a float?
|
pawn Code:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
new Float:angle;
PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
PlayerInfo[playerid][pModel] = 0;
PlayerInfo[playerid][pPos_x] = x;
PlayerInfo[playerid][pPos_y] = y;
PlayerInfo[playerid][pPos_z] = z;
PlayerInfo[playerid][pPos_r] = GetPlayerFacingAngle(playerid, angle);
I defined them and i get the warning about tag mismatch
Re: Help with GetPlayerPos -
blackwave - 17.12.2010
Quote:
Originally Posted by Biesmen
Did you define pPos_X, pPos_y, pPos_z as a float?
|
If he didn't had define that, he'd get this error. I tested here:
Code:
C:\Documents and Settings\F e L i P e\Desktop\Server SAMP\filterscripts\adminx.pwn(746) : error 017: undefined symbol "poss"
pawn Code:
PlayerInfo[playerid][poss] = valor;
Try that, so:
pawn Code:
x = PlayerInfo[playerid][pPos_x];
Re: Help with GetPlayerPos -
matute - 17.12.2010
Quote:
Originally Posted by blackwave
If he didn't had define that, he'd get this error. I tested here:
Code:
C:\Documents and Settings\F e L i P e\Desktop\Server SAMP\filterscripts\adminx.pwn(746) : error 017: undefined symbol "poss"
pawn Code:
PlayerInfo[playerid][poss] = valor;
Try that, so:
pawn Code:
x = PlayerInfo[playerid][pPos_x];
|
YES! it worked, thanks blackwave! I love you! :P
pawn Code:
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase