Problem with GM script
#4

Well this is the whole FS starting from 482 to 519

Код HTML:
dcmd_register(playerid,params[])
{
        new file2[256],pname2[24];
        GetPlayerName(playerid, pname2, sizeof(pname2));
		format(file2, sizeof(file2), "Users/%s.sav", pname2);
		if(!strlen(params)){
			SendClientMessage(playerid, COLOR_ORANGE, "WARNING: /register [password]");
			return 1;}

		new File: file = fopen(string, io_append);
		if(file)
		{
			SendClientMessage(playerid, COLOR_ORANGE, "WARNING: This name is already registered. Usage /login [password]");
			fclose(file);
			return 1;
		}

		new File:hFile;
		hFile = fopen(file2, io_write);

		new var[64];
        PlayerInfo[playerid][Score] = GetPlayerScore(playerid);
        PlayerInfo[playerid][pAdminlevel] = 0;
        PlayerInfo[playerid][pLoggedin] = 1;
        PlayerInfo[playerid][pPassword2] = udb_hash(params);
        format(var, 64, "adminlevel=%d\n",PlayerInfo[playerid][pAdminlevel]);fwrite(hFile, var);
        format(var, 64, "password=%s\n",params);fwrite(hFile, var);
        format(var, 64, "hashPW=%d\n",PlayerInfo[playerid][pPassword2]);fwrite(hFile, var);
        //dini_Set(file2, "password", params);
		format(var, 64, "Kills=%d\n",PlayerInfo[playerid][GoodKillings]);fwrite(hFile, var);
		format(var, 64, "BadKills=%d\n",PlayerInfo[playerid][BadKillings]);fwrite(hFile, var);
        format(var, 64, "Deaths=%d\n",PlayerInfo[playerid][Deaths]);fwrite(hFile, var);
        format(var, 64, "Score=%d\n",PlayerInfo[playerid][Score]);fwrite(hFile, var);
        format(var, 64, "Logged=%d\n",PlayerInfo[playerid][pLoggedin]);fwrite(hFile, var);
		fclose(hFile);
		SendClientMessage(playerid,COLOR_LIGHTGREEN, "ACCOUNT: You are succesfully registered and logged in!!!");
		return 1;
}
Reply


Messages In This Thread
Problem with GM script - by Bilsg - 07.10.2010, 19:55
Re: Problem with GM script - by Hash [NL-RP] - 07.10.2010, 19:57
Re: Problem with GM script - by willsuckformoney - 07.10.2010, 19:59
Re: Problem with GM script - by Bilsg - 07.10.2010, 20:04
Re: Problem with GM script - by willsuckformoney - 07.10.2010, 20:07
Re: Problem with GM script - by Bilsg - 07.10.2010, 20:13
Re: Problem with GM script - by Bilsg - 08.10.2010, 11:07
Re: Problem with GM script - by RenisiL - 08.10.2010, 11:19
Re: Problem with GM script - by Bilsg - 08.10.2010, 13:55

Forum Jump:


Users browsing this thread: 2 Guest(s)