Jump to content

Recommended Posts

Posted

Salut, am sa va arat ce-a mai simpla metoda(cred), cum sa faci o comanda in mai multe limbi.

[glow=black,2,300]1.[/glow] [glow=black,2,400]Adaugam aceasta variablia.[/glow]

[pawn]

enum OptiuniServer {

Limba };

new Option[OptiuniServer];[/pawn]

[glow=black,2,300]2. [/glow][glow=black,2,400]Acum sa facem comanda.[/glow]

[pawn]

if(strcmp(cmd, "/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;

}[/pawn]

Acum, eu v-as recomanda sa faceti, atunci cand un player se logheaza, dupa ce scrie parola sa-i apare un dialog unde sa-si aleaga limba dorita.

[glow=black,2,300]3. [/glow][glow=black,2,400]La OnPlayerLogin pe la sfarsit facem asa.[/glow]

Dialogul:

[pawn]ShowPlayerDialog(playerid,1996,DIALOG_STYLE_LIST,"Limba/Language/Idioma","Romana\nEnghlis\nEspañol","Select", "");[/pawn]

[glow=black,2,300]4. [/glow][glow=black,2,400]La OnDialogResponse adaugam[/glow]

[pawn]

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.");

}

}

}[/pawn]

Cam atat a fost tot...

Bafta :)

 

Guest PlayON
Posted

[pawn]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 [/pawn]

Asta se poate simplifica cu o functie gen:

[pawn]

SCML( p, color, ro[ ], eng[ ], esp[ ] )

{

if ( Option[ Limba ] == 0  ) SendClientMessage( p, color, ro );

else if ( Option[ Limba ] == 1  ) SendClientMessage( p, color, eng );

else if ( Option[ Limba ] == 2  ) SendClientMessage( p, color, esp );

else SendClientMessage( p, color, "An error has occurted" );

return 1;

}[/pawn]

Folosire

[pawn]SCML( playerid, 0xFF0000FF,"Salut", "Hello", "Ola" )[/pawn]

Mai bine ai folosi 0, 1, 2 la Option[ Limba ] si la OnGameModeInit/OnFilterScriptInit pui Option[ Limba ] = 0;

Mai bine sa incepi cu 0 decat cu 1.

Posted

stuntman-=!!" post="67746" timestamp="1303382188"]

5/5

Nu prea stiti sa faceti functii cum a zis Zh3r0...

Stai putin stuntmane :)), Zh3r0 e scripter, noi inca suntem in 'devenire'(sa speram) :))

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.