Hi again
As you can see i want to be able to save points using !shop, now i rent my servers so it can't be to C: drive etc, i have access to ftp and www.
iv'e even tried to use this in C: drive to to see if it gives any errors in log etc but it doesn't, and yet doesn't seem to work at all, The current destination seems irrelevant to what i put in , whether it's C:\\mw3\\shop or what ever. Odd thing when i initially put the code in i did get a error message in log saying it couldn't find xuid 12234456 etc, but then the point wasn't working. Rock kindly help me in placing the code without c# errors but still doesn't work.
Help is appreciated.
As you can see i want to be able to save points using !shop, now i rent my servers so it can't be to C: drive etc, i have access to ftp and www.
iv'e even tried to use this in C: drive to to see if it gives any errors in log etc but it doesn't, and yet doesn't seem to work at all, The current destination seems irrelevant to what i put in , whether it's C:\\mw3\\shop or what ever. Odd thing when i initially put the code in i did get a error message in log saying it couldn't find xuid 12234456 etc, but then the point wasn't working. Rock kindly help me in placing the code without c# errors but still doesn't work.
Help is appreciated.
PHP Code:
public override void OnPlayerConnect(ServerClient Client)
{
try
{
StreamReader reader = new StreamReader(@"shop" + Client.XUID + ".txt");
ServerPrint("StatswillbeWritten2");
string read = reader.ReadLine();
string read2 = read;
string[] readArray = read2.Split('=');
Points[Client.XUID] = int.Parse(readArray[1]);
}
catch { }
PHP Code:
public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, string Weapon, int Damage)
{
if (Damage >= Victim.Other.Health && Attacker.Team != Victim.Team && Victim.XUID != Attacker.XUID)
{
try
{
Points[Attacker.XUID] = (((int)Points[Attacker.XUID]) + 120);
StreamWriter writer = new StreamWriter(@"shop" + Attacker.XUID + ".txt");
int points = (int)Points[Attacker.XUID];
writer.WriteLine(Attacker.XUID + "=" + points.ToString());
writer.Dispose();
writer.Close();
}
catch { }