SA-MP Forums Archive
Saving problem - help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Saving problem - help (/showthread.php?tid=396242)



Saving problem - help - FL3GM4 - 29.11.2012

i have small problem, my script could not save stats

I have this error in CMD of server.cfg:
Код:
*** YSI error: ini_open could not find or create file Players/Nick.ini
this is my onplayerconnect and onplayerdisconnect

Код:
public OnPlayerConnect(playerid)
{
    //PlayAudioStreamForPlayer(playerid, "http://www.croherze.com/introbozic.mp3");
    SetPlayerCameraPos(playerid, -2704.532470,378.131256,14.979453);
	SetPlayerCameraLookAt(playerid, spawnX, spawnY, spawnZ);
	GangZoneShowForPlayer(playerid, RUSGZ, 0xFFFF0096);
	GangZoneShowForPlayer(playerid, FAGZ, 0x0000FF96);
	SendDeathMessage(INVALID_PLAYER_ID,playerid, 200);
	GangZoneShowForPlayer(playerid, GMGZ, 0x00FF0096);
	GangZoneShowForPlayer(playerid, BMGZ, 0x3E887496);
	ping[playerid] = 0;
	pokusaji[playerid] = 0;
	GPSon[playerid] = 0;
	GPSba[playerid] = 0;
	heal[playerid] = 0;
	Cit[playerid] = 0;
	GPSdo[playerid] = 0;
	GPSsp[playerid] = 0;
	Radio[playerid] = 0;
	UBanci[playerid] = 0;
	CB[playerid] = 0;
//	plivanje1[playerid] = 0;
//	plivanje2[playerid] = 0;
	//plivanje3[playerid] = 0;
	new stringe[128];
	format( files,sizeof(files), BAN_FILE, PlayerName(playerid) );
	if( fexist(files) )
	{
	  	format( stringe, sizeof(stringe), ":: %s ::", PlayerName(playerid) );
	  	SendClientMessage(playerid, -1, stringe);
	  	SendClientMessage(playerid, -1, "Vi ste banani sa ovog servera." );
	  	SendClientMessage(playerid, -1, "http://samp.com/" );
	  	Kick(playerid);
	}
    new naslov2[128], text[1024], strText[104];
    format(strText, 35, USER_FILE, PlayerName(playerid));
    if(!INI_Exists(strText))
    {
    	format(naslov2, sizeof(naslov2), "Registracija");
    	format(text, sizeof(text), ""COL_LIGHTBLUE"________________________________________________\n\n"COL_WHITE"Dobrodosao na CroHerzegovina DeathMatch server!\n\n\n"#COL_LIGHTBLUE"%s\n"#COL_WHITE"Tvoj korisnicki racun nije pronaden\n\n\nMolimo upisi svoju lozinku da se registriras:\n\n"COL_LIGHTBLUE"________________________________________________", PlayerName(playerid));
    	ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, naslov2, text, "Register", "Odustani");
    }
    else
    {
        format(naslov2, sizeof(naslov2), ""#COL_WHITE"Logiranje");
        format(text, sizeof(text),""COL_LIGHTBLUE"________________________________________________\n\n"COL_WHITE"Dobrodosao na CroHerzegovina DeathMatch server!\n\n\n"#COL_LIGHTBLUE"%s\n"#COL_WHITE"Tvoj korisnicki racun je pronaden\n\n\nMolimo upisi svoju lozinku da udjes na server:\n\n"COL_LIGHTBLUE"________________________________________________", PlayerName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, naslov2, text, "Login", "Odustani");
    }
	SetPVarInt(playerid, "Prijavljen", 1);
	OcistiChat(playerid);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
 	OnPlayerLogout(playerid);
 	SendDeathMessage(INVALID_PLAYER_ID,playerid, 201);
	return 1;
}



Re: Saving problem - help - FL3GM4 - 30.11.2012

any help !?


Re: Saving problem - help - Ballu Miaa - 30.11.2012

Either the code is not right or the directory is not created!


Re: Saving problem - help - Lordzy - 30.11.2012

It's simple, you recieve that error because the folder named "Players" hasn't been created at the path where it should be created. Create the folder named "Players" at the destination defined on try creating it at Scriptfiles.