Warning help -
Tom1412 - 28.04.2012
hi, I know why the warnings are there but i was wondering if they is a way to remove them?
Proble area
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new X, Y, Z, A;
line 150 GetPlayerPos(playerid, X, Y, Z);
line 151 GetPlayerFacingAngle(playerid, A);
PlayerInfo[playerid][pSpawnX] = X;
PlayerInfo[playerid][pSpawnY] = Y;
PlayerInfo[playerid][pSpawnZ] = Z;
PlayerInfo[playerid][pSpawnA] = A;
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
INI_WriteInt(File,"SpawnX",PlayerInfo[playerid][pSpawnX]);
INI_WriteInt(File,"SpawnY",PlayerInfo[playerid][pSpawnY]);
INI_WriteInt(File,"SpawnZ",PlayerInfo[playerid][pSpawnZ]);
INI_WriteInt(File,"SpawnA",PlayerInfo[playerid][pSpawnA]);
INI_Close(File);
return 1;
}
Warnings
pawn Код:
Base.pwn(150) : warning 213: tag mismatch
Base.pwn(150) : warning 213: tag mismatch
Base.pwn(150) : warning 213: tag mismatch
Base.pwn(151) : warning 213: tag mismatch
4 Warnings.
Re: Warning help -
ViniBorn - 28.04.2012
pawn Код:
INI_WriteFloat(File,"SpawnX",PlayerInfo[playerid][pSpawnX]);
INI_WriteFloat(File,"SpawnY",PlayerInfo[playerid][pSpawnY]);
INI_WriteFloat(File,"SpawnZ",PlayerInfo[playerid][pSpawnZ]);
INI_WriteFloat(File,"SpawnA",PlayerInfo[playerid][pSpawnA]);
Re: Warning help -
admantis - 28.04.2012
Alongside Viniborn's code:
new X, Y, Z, A;
should be...
new Float:X, Float:Y, Float:Z, Float:A;
Certain data values like coordinates, rotations, health, armour, and speed are using 'float' numbers (with decimals), and you defined them as integers.
Re: Warning help -
Tom1412 - 28.04.2012
I still get the warnings and the code works except it don't save the cords right with the "." after the main numbers so when i spawn it puts me out of bounds
Re: Warning help -
ViniBorn - 28.04.2012
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
GetPlayerPos(playerid, PlayerInfo[playerid][pSpawnX], PlayerInfo[playerid][pSpawnY], PlayerInfo[playerid][pSpawnZ]);
GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pSpawnA]);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
INI_WriteFloat(File,"SpawnX",PlayerInfo[playerid][pSpawnX]);
INI_WriteFloat(File,"SpawnY",PlayerInfo[playerid][pSpawnY]);
INI_WriteFloat(File,"SpawnZ",PlayerInfo[playerid][pSpawnZ]);
INI_WriteFloat(File,"SpawnA",PlayerInfo[playerid][pSpawnA]);
INI_Close(File);
return 1;
}
Re: Warning help -
Tom1412 - 28.04.2012
still get the same warning
Re: Warning help -
Jonny5 - 29.04.2012
post your
PlayerInfo enum
you need to add the float tag to
pawn Код:
Float:pSpawnX,
Float:pSpawnY,
Float:pSpawnZ,
Float:pSpawnA,
Re: Warning help -
JaKe Elite - 29.04.2012
Float is not integer
Why you using INI_WriteInt if you can use INI_WriteFloat