Help with GetPlayerPos
#1

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
Reply
#2

Did you define pPos_X, pPos_y, pPos_z as a float?
Reply
#3

Quote:
Originally Posted by Biesmen
View Post
Did you define pPos_X, pPos_y, pPos_z as a float?
yes, i defined them as floats
Reply
#4

Biesmen is right.
Did you define them as a float?
Reply
#5

Quote:
Originally Posted by yvoms
View Post
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
Reply
#6

Quote:
Originally Posted by Biesmen
View Post
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];
Reply
#7

Quote:
Originally Posted by blackwave
View Post
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)