- Регистрация
- 13 Июл 2014
- Сообщения
- 74
- Лучшие ответы
- 0
- Репутация
- 3
В чем может быть проблема?
C++:
stock SavePlayer(playerid)
{
if(!IsPlayerConnected(playerid) || !gPlayerLogged[playerid]) return 1;
new src[90];
sql_str[0] = EOS;
format(src,sizeof(src),"UPDATE accounts SET cash=%d,bank=%d,hp='%.1f',muted=%d,mutetime=%d,",pInfo[playerid][pCash],pInfo[playerid][pBank],pInfo[playerid][pHP],pInfo[playerid][pMuted],pInfo[playerid][pMuteTime]);
strcat(sql_str,src,sizeof(sql_str));
for(new i; i < 13; i++)
{
format(src,sizeof(src),"`slot%d`=%d,",i+1,pInfo[playerid][pSlot][i]);
strcat(sql_str,src,sizeof(sql_str));
format(src,sizeof(src),"`slotammo%d`=%d,",i+1,pInfo[playerid][pSlotammo][i]);
strcat(sql_str,src,sizeof(sql_str));
}
format(src,sizeof(src),"boxskill=%d,kongfuskill=%d,kickboxskill=%d WHERE id=%d LIMIT 1",pInfo[playerid][pBoxSkill],pInfo[playerid][pKongfuSkill],pInfo[playerid][pKickboxSkill],pInfo[playerid][pID]);
strcat(sql_str,src,sizeof(sql_str));
mysql_tquery(dbHandle, sql_str);
return 1;
}
stock SaveWeapon(playerid)
{
for(new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid,i,pInfo[playerid][pSlot][i],pInfo[playerid][pSlotammo][i]);
}
return true;
}
В загрузке аккаунта
cache_get_value_name_int(0, "slot1", pInfo[playerid][pSlot][0]);
cache_get_value_name_int(0, "slot2", pInfo[playerid][pSlot][1]);
cache_get_value_name_int(0, "slot3", pInfo[playerid][pSlot][2]);
cache_get_value_name_int(0, "slot4", pInfo[playerid][pSlot][3]);
cache_get_value_name_int(0, "slot5", pInfo[playerid][pSlot][4]);
cache_get_value_name_int(0, "slot6", pInfo[playerid][pSlot][5]);
cache_get_value_name_int(0, "slot7", pInfo[playerid][pSlot][6]);
cache_get_value_name_int(0, "slot8", pInfo[playerid][pSlot][7]);
cache_get_value_name_int(0, "slot9", pInfo[playerid][pSlot][8]);
cache_get_value_name_int(0, "slot10", pInfo[playerid][pSlot][9]);
cache_get_value_name_int(0, "slot11", pInfo[playerid][pSlot][10]);
cache_get_value_name_int(0, "slot12", pInfo[playerid][pSlot][11]);
cache_get_value_name_int(0, "slot13", pInfo[playerid][pSlot][12]);
cache_get_value_name_int(0, "slotammo1", pInfo[playerid][pSlotammo][0]);
cache_get_value_name_int(0, "slotammo2", pInfo[playerid][pSlotammo][1]);
cache_get_value_name_int(0, "slotammo3", pInfo[playerid][pSlotammo][2]);
cache_get_value_name_int(0, "slotammo4", pInfo[playerid][pSlotammo][3]);
cache_get_value_name_int(0, "slotammo5", pInfo[playerid][pSlotammo][4]);
cache_get_value_name_int(0, "slotammo6", pInfo[playerid][pSlotammo][5]);
cache_get_value_name_int(0, "slotammo7", pInfo[playerid][pSlotammo][6]);
cache_get_value_name_int(0, "slotammo8", pInfo[playerid][pSlotammo][7]);
cache_get_value_name_int(0, "slotammo9", pInfo[playerid][pSlotammo][8]);
cache_get_value_name_int(0, "slotammo10", pInfo[playerid][pSlotammo][9]);
cache_get_value_name_int(0, "slotammo11", pInfo[playerid][pSlotammo][10]);
cache_get_value_name_int(0, "slotammo12", pInfo[playerid][pSlotammo][11]);
cache_get_value_name_int(0, "slotammo13", pInfo[playerid][pSlotammo][12]);[/pHP]