Jump to content
  • 0

am mare nevoie de ajutor


KiLLeRZoNE

Question

5 answers to this question

Recommended Posts

Posteza codu sau ai lock.

[pawn]

// This is a comment

// uncomment the line below if you want to write a filterscript

//#define FILTERSCRIPT

#include <a_samp>

enum OptiuniServer {

Limba };

new Option[OptiuniServer];

#if defined FILTERSCRIPT

public OnFilterScriptInit()

{

print("\n--------------------------------------");

print(" Blank Filterscript by your name here");

print("--------------------------------------\n");

return 1;

}

public OnFilterScriptExit()

{

return 1;

}

#else

main()

{

print("\n----------------------------------");

print(" Blank Gamemode by your name here");

print("----------------------------------\n");

}

#endif

public OnGameModeInit()

{

// Don't use these lines if it's a filterscript

SetGameModeText("Blank Script");

AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);

return 1;

}

public OnGameModeExit()

{

return 1;

}

public OnPlayerCommandText(playerid, cmdtext[])

{

if(strcmp(cmdtext, "/cmdtest", true) == 0)

{

if(Option[Limba] ==1)SendClientMessage(playerid, 0xFFFFFFAA, "** Salut George ce faci?");else // Romana

if(Option[Limba] ==2)SendClientMessage(playerid, 0xFFFFFFAA, "** Hi Tom how are you?");else // Engleza

if(Option[Limba] ==3)SendClientMessage(playerid, 0xFFFFFFAA, "** Hola Xavi que passa?"); // Spaniola

                // s.a.m.d cate limbi doriti voi

return 1;

}

return 0;

}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

{

if(dialogid == 1996)

{

if(response)

{

            if(listitem == 0)

{

                Option[Limba] = 1;

                SendClientMessage(playerid, 0xFFFFFFAA, "** Ai selectat limba romana.");

}

if(listitem == 1)

{

      Option[Limba] = 2;

      SendClientMessage(playerid, 0xFFFFFFAA, "** You have selected enghlish language.");

}

if(listitem == 2)

{

      Option[Limba] = 3;

      SendClientMessage(playerid, 0xFFFFFFAA, "** Lengua española se ha seleccionado.");

}

}

}

return 1;

}

[/pawn]

<img src="http://s15.postimage.org/q6s3fuq4r/snapshotoronthefolldsangdsa.png">

Link to comment
Share on other sites

Normal ca nu merge, daca nu ai bagat sa se seteze la inceput o limba default ... nici macar nu arati acel dialog de selectare a limbii + e facut sa fie doar limba la server aia, nu limba la fiecare jucator.

http://wiki.sa-mp.com/wiki/ShowPlayerDialog

Ti-am facut eu cum trebuie, modifica acel cod in asta:

#include <a_samp>

enum OptiuniServer 
{
	Limba 
};
new Option[ MAX_PLAYERS ][OptiuniServer];

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

public OnGameModeInit()
{
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerConnect( playerid )
{
	Option[ playerid ][ Limba ] = 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/cmdtest", true) == 0)
	{
		if(Option[playerid][Limba] ==1)SendClientMessage(playerid, 0xFFFFFFAA, "** Salut George ce faci?");else // Romana
		if(Option[playerid][Limba] ==2)SendClientMessage(playerid, 0xFFFFFFAA, "** Hi Tom how are you?");else // Engleza
		if(Option[playerid][Limba] ==3)SendClientMessage(playerid, 0xFFFFFFAA, "** Hola Xavi que passa?"); // Spaniola
                // s.a.m.d cate limbi doriti voi
		return 1;
	}
	if( strcmp( cmdtext, "/language", true ) == 0 )
	{
		ShowPlayerDialog( playerid, 1996, DIALOG_STYLE_LIST, "Limba", "Romana\nEnglish\nSpanish", "Select", "Cancel" ); 
		return 1;
	}
	return 0;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1996)
	{
		if( !response )
			return 1;

		if(listitem == 0)
		{
			Option[playerid][Limba] = 1;
			SendClientMessage(playerid, 0xFFFFFFAA, "** Ai selectat limba romana.");
		}
		if(listitem == 1)
		{
			Option[playerid][Limba] = 2;
			SendClientMessage(playerid, 0xFFFFFFAA, "** You have selected enghlish language.");
		}
		if(listitem == 2)
		{
			Option[playerid][Limba] = 3;
			SendClientMessage(playerid, 0xFFFFFFAA, "** Lengua española se ha seleccionado.");
		}
	}
	return 1;
}

Comanda /language adaugata, ca sa-ti alegi limba. Ca sa adaugi mesaje fa ca in /testcmds, mai simplu ai creea o functie SendLanguageMessage( playerid, color, ro[], eng[], spanish[] ).

Link to comment
Share on other sites

stuntman[]!" post="100839" timestamp="1322152537"]

Normal ca nu merge, daca nu ai bagat sa se seteze la inceput o limba default ... nici macar nu arati acel dialog de selectare a limbii + e facut sa fie doar limba la server aia, nu limba la fiecare jucator.

http://wiki.sa-mp.com/wiki/ShowPlayerDialog

Ti-am facut eu cum trebuie, modifica acel cod in asta:

#include <a_samp>

enum OptiuniServer 
{
	Limba 
};
new Option[ MAX_PLAYERS ][OptiuniServer];

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

public OnGameModeInit()
{
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerConnect( playerid )
{
	Option[ playerid ][ Limba ] = 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/cmdtest", true) == 0)
	{
		if(Option[playerid][Limba] ==1)SendClientMessage(playerid, 0xFFFFFFAA, "** Salut George ce faci?");else // Romana
		if(Option[playerid][Limba] ==2)SendClientMessage(playerid, 0xFFFFFFAA, "** Hi Tom how are you?");else // Engleza
		if(Option[playerid][Limba] ==3)SendClientMessage(playerid, 0xFFFFFFAA, "** Hola Xavi que passa?"); // Spaniola
                // s.a.m.d cate limbi doriti voi
		return 1;
	}
	if( strcmp( cmdtext, "/language", true ) == 0 )
	{
		ShowPlayerDialog( playerid, 1996, DIALOG_STYLE_LIST, "Limba", "Romana\nEnglish\nSpanish", "Select", "Cancel" ); 
		return 1;
	}
	return 0;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1996)
	{
		if( !response )
			return 1;

		if(listitem == 0)
		{
			Option[playerid][Limba] = 1;
			SendClientMessage(playerid, 0xFFFFFFAA, "** Ai selectat limba romana.");
		}
		if(listitem == 1)
		{
			Option[playerid][Limba] = 2;
			SendClientMessage(playerid, 0xFFFFFFAA, "** You have selected enghlish language.");
		}
		if(listitem == 2)
		{
			Option[playerid][Limba] = 3;
			SendClientMessage(playerid, 0xFFFFFFAA, "** Lengua española se ha seleccionado.");
		}
	}
	return 1;
}

Comanda /language adaugata, ca sa-ti alegi limba. Ca sa adaugi mesaje fa ca in /testcmds, mai simplu ai creea o functie SendLanguageMessage( playerid, color, ro[], eng[], spanish[] ).

ms mult.....

<img src="http://s15.postimage.org/q6s3fuq4r/snapshotoronthefolldsangdsa.png">

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.