CrystyaN Posted April 21, 2011 Report Share Posted April 21, 2011 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 Quote Link to comment Share on other sites More sharing options...
Costy1998 Posted April 21, 2011 Report Share Posted April 21, 2011 Frumos.5/5 :wink: Quote Link to comment Share on other sites More sharing options...
Guest PlayON Posted April 21, 2011 Report Share Posted April 21, 2011 [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. Quote Link to comment Share on other sites More sharing options...
CrystyaN Posted April 21, 2011 Author Report Share Posted April 21, 2011 Mersi, Zh3r0, nu stiam :) Quote Link to comment Share on other sites More sharing options...
NeKeRm@N Posted April 21, 2011 Report Share Posted April 21, 2011 bun tutorial si bun si ce a zis 0 Quote Link to comment Share on other sites More sharing options...
xxSPEEDYxx Posted April 21, 2011 Report Share Posted April 21, 2011 bv 5/5;) Quote Fara reclama in semnatura! Link to comment Share on other sites More sharing options...
vampir_MD Posted April 21, 2011 Report Share Posted April 21, 2011 Foarte bun bv 5/5 Quote Link to comment Share on other sites More sharing options...
BlueSkiLLz Posted April 21, 2011 Report Share Posted April 21, 2011 bv 5/5;) Quote Link to comment Share on other sites More sharing options...
IstuntmanI Posted April 21, 2011 Report Share Posted April 21, 2011 5/5Nu prea stiti sa faceti functii cum a zis Zh3r0... Quote Link to comment Share on other sites More sharing options...
CrystyaN Posted April 21, 2011 Author Report Share Posted April 21, 2011 stuntman-=!!" post="67746" timestamp="1303382188"]5/5Nu prea stiti sa faceti functii cum a zis Zh3r0...Stai putin stuntmane ), Zh3r0 e scripter, noi inca suntem in 'devenire'(sa speram) ) Quote Link to comment Share on other sites More sharing options...
ruben88 Posted April 21, 2011 Report Share Posted April 21, 2011 Bun tutorial,bravo :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.