Jump to content

Va rog ajutor


xView

Recommended Posts

 Cum fac ca atunci cand un jucator inta pe server sa-i verifice fisierele, gen daca nu are fisierul exemplu.txt sa-i dea kick

Bot developer (Discord): https://discordapp.com/oauth2/authorize?client_id=584989992481193989&scope=bot&permissions=8

Web Developer (Disponibil pentru proiecte noi, experienta de 3 ani in php, mysql si web design)

Scripter SA:MP (Am reinceput sa lucrez in domeniul acesta pentru a sustine comunitatea de samp dupa o pauza de 2 ani)

Link to comment
Share on other sites

4 minutes ago, View404 said:

 Cum fac ca atunci cand un jucator inta pe server sa-i verifice fisierele, gen daca nu are fisierul exemplu.txt sa-i dea kick

gen la onplayerconnect sa verifice fisierele din 'exemplu/desktop/gamemode/scriptfiles/(creeza un folder)' si daca nu e nici un fisier, sa dea kick la playerul respectiv.

Edited by tHe
design.
Link to comment
Share on other sites

Da, asta ziceam. Cum fac sa le verifice?

Bot developer (Discord): https://discordapp.com/oauth2/authorize?client_id=584989992481193989&scope=bot&permissions=8

Web Developer (Disponibil pentru proiecte noi, experienta de 3 ani in php, mysql si web design)

Scripter SA:MP (Am reinceput sa lucrez in domeniul acesta pentru a sustine comunitatea de samp dupa o pauza de 2 ani)

Link to comment
Share on other sites

iti trebuie un o functie prin care sa salveze fiecare player  in fisiere diferite care sa contina anumite informatii gen 

//OnPlayerConnect
    GetPlayerName(playerid, plname, sizeof(plname));
	format(string, sizeof(string), "folder/%s.ini", plname);
	
//OnPlayerRegister	
    GetPlayerName(playerid, playername3, sizeof(playername3));
	format(string3, sizeof(string3), "folder/%s.ini", playername3);
	new File: hFile = fopen(string3, io_write);
	if (hFile)
	{
		//aici pui tu ce vrei tu sa fie salvat  
		new var[32];
		fwrite(hFile, var);
		format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
		
		return 1;
	}

//OnPlayerUpdateEx	
   GetPlayerName(playerid, playername3, sizeof(playername3));
	format(string3, sizeof(string3), "folder/%s.ini", playername3);
	new File: hFile = fopen(string3, io_write);
	if (hFile)
	{
		//aici va fi salvat gen andu.txt la fel trebuie pus aici cum este si la OnPlayerRegister
		
		new var[32];
		fwrite(hFile, var);
		format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
		return 1;
	}


//OnPlayerLogin

    GetPlayerName(playerid, playername2, sizeof(playername2));
    GetPlayerIp(playerid, playersip, sizeof(playersip));
	format(string2, sizeof(string2), "folder/%s.ini", playername2);
	new File: UserFile = fopen(string2, io_read);
	if ( UserFile )
	{
        //exemplu asa 
		while ( fread( UserFile , Data , sizeof( Data ) ) )
		{
			key = ini_GetKey( Data );
			if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
		}	
	
	    return 1;
	}
// cam atat ce mi-a trecut mie prin cap sa iti arat cum se face

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.