08.12.2015, 01:19
All this data shows up as 0 when its supposed to have a number and has one in the mysql table.
Код:
public OnLoadCharacter(playerid, charid) { new id_string[128]; new rows,fields; cache_get_data(rows,fields); cache_get_row(0, 16, id_string); SetPVarInt(playerid, "SkinID", strval(id_string)); cache_get_row(0, 3, id_string); SetPVarInt(playerid, "Money", strval(id_string)); cache_get_row(0, 5, id_string); SetPVarInt(playerid, "Score", strval(id_string)); cache_get_row(0, 7, id_string); SetPVarInt(playerid, "Kills", strval(id_string)); cache_get_row(0, 6, id_string); SetPVarInt(playerid, "Deaths", strval(id_string)); cache_get_row(0, 12, id_string); SetPVarInt(playerid, "Age", strval(id_string)); cache_get_row(0, 13, id_string); SetPVarInt(playerid, "Sex", strval(id_string)); new X,Y,Z; cache_get_row(0, 8, id_string); X = strval(id_string); cache_get_row(0, 9, id_string); Y = strval(id_string); cache_get_row(0, 10, id_string); Z = strval(id_string); cache_get_row(0, 15, id_string); SetPVarInt(playerid, "VW", strval(id_string)); cache_get_row(0, 1, id_string); new name[128], msg[128]; name = id_string; SetPVarString(playerid, "CharacterName", name); SetPlayerName(playerid, name); format(msg, sizeof(msg), "Age %d | Sex %d | Money %d | Username %s", GetPVarInt(playerid, "Age"), GetPVarInt(playerid, "Sex"), GetPVarInt(playerid, "Money"), name); SendClientMessage(playerid, COLOR_RED, msg); SetSpawnInfo(playerid, 0, GetPVarInt(playerid, "SkinID"), X, Y, Z, GetPVarInt(playerid,"FacingAngle"),0,0,0,0,0,0); SpawnPlayer(playerid); return 1; }