07.11.2015, 14:46
So i tried to use a timer (every 1.5minute) to save stats and position.
I noticed it saves all stats except of x,y,z coords even if at the rcon it prints the current coords of the player
I saves 0,0,0 at posx,posy,posz
I noticed it saves all stats except of x,y,z coords even if at the rcon it prints the current coords of the player
pawn Код:
function StatsUpdating(playerid)
{
if(pinfo[playerid][Logged] == 1 && IsPlayerConnected(playerid)|| pinfo[playerid][Registered] ==1 && IsPlayerConnected(playerid))
{
new query[340],Float:pos[3];
GetPlayerPos(playerid, pos[0],pos[1],pos[2]);
pinfo[playerid][Skin] = GetPlayerSkin(playerid);
pinfo[playerid][Team] = GetPlayerTeam(playerid);
pinfo[playerid][Money] = GetPlayerMoney(playerid);
pinfo[playerid][Score] = GetPlayerScore(playerid);
mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `Admin`=%d, `VIP`=%d, `Money`=%d,`posX` =%f,`posY` =%f,`posZ`=%f,\
`Score` =%d, `Banned` =%d, `Cuffed` =%d, `Muted` =%d, `Jailed` =%d, `JailTime` =%d, `Drugs` =%d, `DrugAmount` =%d, `Robskill` =%d, `Hitmanskill` =%d, `Terskill` =%d, `TotalRobs` =%d,\
`Skin` =%d, `Team` =%d, `Kills` =%d, `Deaths`=%d WHERE `ID`=%d",
pinfo[playerid][Admin], pinfo[playerid][VIP],pinfo[playerid][Money],pos[0],pos[1],pos[2],
pinfo[playerid][Score],pinfo[playerid][Banned], pinfo[playerid][Cuffed],pinfo[playerid][Muted],
pinfo[playerid][Jailed],pinfo[playerid][JailTime],pinfo[playerid][Drug],pinfo[playerid][DrugAmount],
pinfo[playerid][Robskill],pinfo[playerid][Hitmanskill],pinfo[playerid][Terskill],pinfo[playerid][TotalRobs],pinfo[playerid][Skin],
pinfo[playerid][Team],pinfo[playerid][Kills],pinfo[playerid][Deaths],pinfo[playerid][ID]);
print("Stats of the player have been updated!");
printf("Coords updated X: %f Y : %f Z:%f",pos[0],pos[1],pos[2]);
}
return 1;
}