Hi, i'm trying to change the way my server saves info to a database instead of a txt file due to the large amount of files.
currently below is how weapons etc are bought. Need direction to change checking points in database and deducting from ammount.
int points = (int)Points[Client.XUID];
//Secondarys
string SCORPACost = GetServerCFG("shop", "SCORPACost", "");
etc
if (Message == "!17")
{
int mp7Cost2 = Convert.ToInt32(mp7Cost);
if ((int)Points[Client.XUID] < mp7Cost2) <<<< how to check in data base ?
{
iPrintLnBold("^1Not enough points!", Client);
}
else
{
int WepID = GetWeapon("iw5_mp7_mp_reflexsmg_camo03");
Client.Other.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
Client.Ammo.PrimaryAmmoClip = 140;
Client.Ammo.PrimaryAmmo = 50;
Client.Ammo.EquipmentAmmo = 1;
Client.Ammo.OffhandAmmo = 1;
Points[Client.XUID] = ((int)Points[Client.XUID]) - mp7Cost2; <<<<<<<<<<<< hw to deduct from database?
}
return ChatType.ChatNone;
}
I have already setup a hud for points which works. Help appreciated
creds
@Sailormoon for original code
currently below is how weapons etc are bought. Need direction to change checking points in database and deducting from ammount.
int points = (int)Points[Client.XUID];
//Secondarys
string SCORPACost = GetServerCFG("shop", "SCORPACost", "");
etc
if (Message == "!17")
{
int mp7Cost2 = Convert.ToInt32(mp7Cost);
if ((int)Points[Client.XUID] < mp7Cost2) <<<< how to check in data base ?
{
iPrintLnBold("^1Not enough points!", Client);
}
else
{
int WepID = GetWeapon("iw5_mp7_mp_reflexsmg_camo03");
Client.Other.PrimaryWeapon = WepID;
Client.Other.CurrentWeapon = WepID;
Client.Ammo.PrimaryAmmoClip = 140;
Client.Ammo.PrimaryAmmo = 50;
Client.Ammo.EquipmentAmmo = 1;
Client.Ammo.OffhandAmmo = 1;
Points[Client.XUID] = ((int)Points[Client.XUID]) - mp7Cost2; <<<<<<<<<<<< hw to deduct from database?
}
return ChatType.ChatNone;
}
I have already setup a hud for points which works. Help appreciated
creds
@Sailormoon for original code