• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [ERROR] cache_set_active: invalid cache id '0'
#1
Whatis going on to these code



Orginal code from:?https://github.com/pBlueG/SA-MP-MySQ...stem-cache.pwn



Code:
[19:02:17] [ERROR] cache_set_active: invalid cache id '0'

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_get_value_name_float: no active cache

[19:02:17] [ERROR] cache_get_value_name_float: no active cache

[19:02:17] [ERROR] cache_get_value_name_float: no active cache

[19:02:17] [ERROR] cache_get_value_name_float: no active cache

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_delete: invalid cache id '0' ?



Code:
? ? ? ?case DIALOG_LOGIN:

? ? ? ?{

? ? ? ? ? ?if (!response) return Kick(playerid);



? ? ? ? ? ?new hashed_pass[65];

? ? ? ? ? ?SHA256_PassHash(inputtext, Player[playerid][Salt], hashed_pass, 65);



? ? ? ? ? ?if (strcmp(hashed_pass, Player[playerid][Password]) == 0)

? ? ? ? ? ?{



? ? ? ? ? ? ? ?// sets the specified cache as the active cache so we can retrieve the rest player data

? ? ? ? ? ? ? ?cache_set_active(Player[playerid][Cache_ID]);



? ? ? ? ? ? ? ?AssignPlayerData(playerid);



? ? ? ? ? ? ? ?// remove the active cache from memory and unsets the active cache as well

? ? ? ? ? ? ? ?cache_delete(Player[playerid][Cache_ID]);

? ? ? ? ? ? ? ?Player[playerid][Cache_ID] = MYSQL_INVALID_CACHE;



? ? ? ? ? ? ? ?KillTimer(Player[playerid][LoginTimer]);

? ? ? ? ? ? ? ?Player[playerid][LoginTimer] = 0;

? ? ? ? ? ? ? ?Player[playerid][IsLoggedIn] = true;

? ? ? ? ? ? ? ?TogglePlayerSpectating(playerid, false);



? ? ? ? ? ? ? ?// spawn the player to their last saved position after login

? ? ? ? ? ? ? ?SetSpawnInfo(playerid, NO_TEAM, DEFAULT_SKIN, Player[playerid][Pos_X], Player[playerid][Pos_Y], Player[playerid][Pos_Z], Player[playerid][Pos_A], 0, 0, 0, 0, 0, 0);

? ? ? ? ? ? ? ?SpawnPlayer(playerid);

? ? ? ? ? ?}

? ? ? ? ? ?else

? ? ? ? ? ?{

? ? ? ? ? ? ? ?Player[playerid][LoginAttempts];



? ? ? ? ? ? ? ?if (Player[playerid][LoginAttempts] >= 3)

? ? ? ? ? ? ? ?{

? ? ? ? ? ? ? ? ? ?ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "[Login step]", "?س??????ʼ?ҹ?Դ?֧ 3 ?????, ?֧ⴹ?к?????͡?ҡ???????????", "?Դ", "");

? ? ? ? ? ? ? ? ? ?DelayedKick(playerid);

? ? ? ? ? ? ? ?}

? ? ? ? ? ? ? ?else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "[Login step]", "???ʼ?ҹ????١??ͧ!\n**??س???????ʼ?ҹ????????????????!", "???????", "¡??ԡ");

? ? ? ? ? ?}

? ? ? ?}



AssignPlayerData(playerid)

{

? ?cache_get_value_int(0, "ID", Player[playerid][ID]);



? ?cache_get_value_int(0, "Kills", Player[playerid][Kills]);

? ?cache_get_value_int(0, "Deaths", Player[playerid][Deaths]);



? ?cache_get_value_float(0, "PosX", Player[playerid][Pos_X]);

? ?cache_get_value_float(0, "PosY", Player[playerid][Pos_Y]);

? ?cache_get_value_float(0, "PosZ", Player[playerid][Pos_Z]);

? ?cache_get_value_float(0, "PosA", Player[playerid][Pos_A]);

? ?

? ?cache_get_value_int(0, "Interior", Player[playerid][Interior]);

? ?cache_get_value_int(0, "Skin", Player[playerid][Skin]);

? ?cache_get_value_int(0, "Account", Player[playerid][Account]);

? ?return 1;

} ?



error spot after logged in every login
  Reply
#2
Caches are automatically deleted when the query callback ends. It looks like you are trying to use it later, and it probably no longer exists because it wasn't saved.
  Reply


Forum Jump: