Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define USODINI true //Deixe true Caso Você Use DINI
- #define USODOF2 false //Marque true Caso Você Use DOF2
- #include <a_samp>
- #if USODINI == true
- #include <dini>
- #endif
- #if USODOF2 == true
- #include <DOF2>
- #endif
- #define FILTERSCRIPT
- #define PASTADOJOGADORES "PastacaConta/%s.ini" //Mude a Pasta onde ta Os Jogadores
- #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- public OnFilterScriptInit()
- {
- print("Criado Por: DoDo - GTO Torcidas
- return 0x01;
- }
- public OnFilterScriptExit()
- {
- #if USODOF2 == true
- DOF2_Exit();
- #endif
- return 0x01;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- dcmd(mudarnick,9,cmdtext);
- dcmd(mudarsenha,10,cmdtext);
- return 0x01;
- }
- dcmd_mudarnick(playerid, params[])
- {
- if (!strlen(params)) return SendClientMessage(playerid, -1, "Uso Correto: /mudarmeunick <Novo Nick>");
- if (strlen(params) > 30) return SendClientMessage(playerid, -1, "Novo nick deve ser de 1 a 30 caracteres!");
- new stringa[80];
- format(stringa,sizeof(stringa),PASTADOJOGADORES,ReturnPlayer(playerid));
- if(fexist(stringa))
- {
- new stringa2[80];
- format(stringa2,sizeof(stringa2),PASTADOJOGADORES,strlen(params));
- if(fexist(stringa2)) return SendClientMessage(playerid, -1, "Esse Nick ja esta registrado no servidor!");
- frename(stringa,stringa2);
- SetPlayerName(playerid, params);
- return 0x01;
- }
- return 0x01;
- }
- dcmd_mudarsenha(playerid, params[])
- {
- if (!strlen(params)) return SendClientMessage(playerid, -1, "Uso Correto: /mudarsenha <Nova Senha>");
- if (strlen(params) > 100) return SendClientMessage(playerid, -1, "Nova senha deve ser de 1 a 100 caracteres!");
- new stringa[80];
- format(stringa,sizeof(stringa),PASTADOJOGADORES,ReturnPlayer(playerid));
- #if USODINI == true
- if(dini_Exists(stringa))
- {
- AtualizarDiniStr(playerid,"senha", params); //Criado Por DoDo - GTO Torcidas
- format(stringa,sizeof(stringa),"Você mudou sua senha para: %s",strlen(params));
- SendClientMessage(playerid, -1, stringa);
- return 0x01;
- }
- #endif
- #if USODOF2 == true
- if(DOF2_FileExists(stringa))
- {
- AtualizarDof2Str(playerid,"senha", params); //Criado Por DoDo - GTO Torcidas
- format(stringa,sizeof(stringa),"Você mudou sua senha para: %s",strlen(params));
- SendClientMessage(playerid, -1, stringa);
- return 0x01;
- }
- #endif
- return 0x01;
- }
- stock ReturnPlayer(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,MAX_PLAYER_NAME);
- return name;
- }
- stock frename(oldname[],newname[])
- {
- if(fexist(oldname) && !fexist(newname))
- {
- new File: oldfile, File: newfile, str[0x800];
- oldfile = fopen(oldname, io_read);
- newfile = fopen(newname, io_write);
- fread(oldfile, str);
- fclose(oldfile);
- fremove(oldname);
- fwrite(newfile, str);
- fclose(newfile);
- return 1;
- }
- return 0;
- }
- #if USODINI == true
- AtualizarDiniStr(idpvt,local[], quant[])
- {
- new stringa[80];
- format(stringa,sizeof(stringa),PASTADOJOGADORES,ReturnPlayer(idpvt));
- dini_Set(stringa, local, quant);
- return 0x01;
- }
- #endif
- #if USODOF2 == true
- AtualizarDof2Str(idpvt,local[], quant[])
- {
- new stringa[80];
- format(stringa,sizeof(stringa),PASTADOJOGADORES,ReturnPlayer(idpvt));
- DOF2_SetString(stringa, local, quant);
- DOF2_SaveFile();
- return 0x01;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement