Jump to content
  • 0

Problema /fbalance mysql


WiDuAlK

Question

 

Problema intalnita (descriere): Salutare , am incercat sa creez o comanda /fbalance pentru a verifica suma ce este in depozitul factiunii, dar nu merge... imi apare la suma 0.Tin sa mentionez folosesc R33 ideal pentru RPG
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul:

Include:

enum fInfo
{
     pDepMoney, pDepMats, pDepDrugs
};
new FactionInfo[201][fInfo];
 
public Update(playerid, type)
{
    if(IsPlayerConnected(playerid))
    {
        new string[256],
        playerName[MAX_PLAYER_NAME],
        FactionID[200];
        GetPlayerName(playerid, playerName, sizeof(playerName));
        {
            switch(type)
            {
                //Factiuni
                case pDepMoneyu:
                {
                    mysql_format(handle, string, sizeof(string), "UPDATE `factiuni` SET `Money`='%d' WHERE `ID`='%i'", FactionInfo[MAX_FACTIONS][ pDepMoney], FactionID);
                    mysql_query(handle, string);
                }
                case pDepMatsu:
                {
                    mysql_format(handle, string, sizeof(string), "UPDATE `factiuni` SET `Mats`='%d' WHERE `ID`='%i'", FactionInfo[MAX_FACTIONS][ pDepMats], FactionID);
                    mysql_query(handle, string);
                }
                case pDepDrugsu:
                {
                    mysql_format(handle, string, sizeof(string), "UPDATE `factiuni` SET `Drugs`='%d' WHERE `ID`='%i'", FactionInfo[MAX_FACTIONS][ pDepDrugs], FactionID);
                    mysql_query(handle, string);
                }
                
            }
        }
    }
}
 
comanda:

mcmd:fbalance(playerid,params[])
  {
    new string[200];
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
    {
      if(IsPlayerInRangeOfPoint(playerid,3,697.9628,-1281.5386,13.7009))
      {
        format(string,sizeof(string),"SELECT `Money` FROM `factiuni` WHERE `ID` = 1 LIMIT 1;");
        mysql_tquery(handle,string);
        format(string,sizeof(string), "Depozitul detine suma de %d$.",string);
        SendClientMessage(playerid, COLOR_SYN2, string);
      }
    }
    return 1;
  }
 
Imagini / Video (optional):Nu este nevoie
Ati incercat sa rezolvati singur?: Da
 
 
 
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.