09.01.2016, 22:57
Bom eu queria fazer um comando de mudar senha, e as contas estao salvas em arquivos ini's so que nao sei modificar arquivos ini's alguem pode me ajudar ?
DOF2_SetString("arquivo.ini", "Senha", novasenha);
new nome[24]; GetPlayerName(playerid, nome, sizeof(nome)); new arquivos[40] format(arquivos, sizeof(arquivos), "Contas/%s.ini", nome); DOF2_SetString(arquivos, "Senha", novasenha); DOF2_SaveFile(); |
C:\Users\User\Desktop\GM.pwn(1959) : error 001: expected token: ";", but found "-identifier-" C:\Users\User\Desktop\GM.pwn(1961) : error 017: undefined symbol "novasenha" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
CMD:trocarsenha(playerid, params[]) { new nome[24]; GetPlayerName(playerid, nome, sizeof(nome)); new arquivos[40] format(arquivos, sizeof(arquivos), "acc/%s.ini", nome); DOF2_SetString(arquivos, "Senha", novasenha); DOF2_SaveFile(); return 1; }
#define CONTAS "acc/%s.ini" // no comeзo da gm |
CMD:trocarsenha(playerid, params[]) { #pragma unused params #pragma unused playerid new index = 0,NewPassword[256]; NewPassword = strtok(params,index); new string[128]; if(!strlen(params)) return SendClientMessage(playerid,COR_USOCORRETO,"LOG- /mudarsenha [nova senha]"); else if(12 < strlen(params) || strlen(params) < 4 || !IsValidNick(params)) return SendClientMessage(playerid, COR_ERRO, "Senha deve ser de 4 a 12 dнgitos || Somente caraceteres simples."); format(string, sizeof(string), CONTAS, getPName(playerid)); DOF2_SetString(string,"Senha", NewPassword); DOF2_SaveFile(); return 1; } |
CMD:trocarsenha(playerid, params[]) { new nome[24]; GetPlayerName(playerid, nome, sizeof(nome)); new arquivos[40]; format(arquivos, sizeof(arquivos), "acc/%s.ini", nome); DOF2_SetString(arquivos, "Senha", novasenha); DOF2_SaveFile(); return 1; } |
C:\Users\User\Desktop\GM.pwn(1209) : error 017: undefined symbol "strtok" C:\Users\User\Desktop\GM.pwn(1209) : error 033: array must be indexed (variable "NewPassword") C:\Users\User\Desktop\GM.pwn(1212) : error 017: undefined symbol "COR_USOCORRETO" C:\Users\User\Desktop\GM.pwn(1214) : error 017: undefined symbol "IsValidNick" C:\Users\User\Desktop\GM.pwn(1215) : error 017: undefined symbol "COR_ERRO" C:\Users\User\Desktop\GM.pwn(1217) : error 017: undefined symbol "getPName" C:\Users\User\Desktop\GM.pwn(1208) : warning 204: symbol is assigned a value that is never used: "index" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors.
CMD:mudarsenha(playerid, params[])
{
new Name[25], Str[70];
GetPlayerName(playerid, Name, 25);
format(Str, sizeof(Str), "acc/%s.ini", Name);
DOF2_SetString(Str, "Password", params);
DOF2_SaveFile();
return true;
}
Seu comando deu os seguintes erros :
Код:
C:\Users\User\Desktop\GM.pwn(1209) : error 017: undefined symbol "strtok" C:\Users\User\Desktop\GM.pwn(1209) : error 033: array must be indexed (variable "NewPassword") C:\Users\User\Desktop\GM.pwn(1212) : error 017: undefined symbol "COR_USOCORRETO" C:\Users\User\Desktop\GM.pwn(1214) : error 017: undefined symbol "IsValidNick" C:\Users\User\Desktop\GM.pwn(1215) : error 017: undefined symbol "COR_ERRO" C:\Users\User\Desktop\GM.pwn(1217) : error 017: undefined symbol "getPName" C:\Users\User\Desktop\GM.pwn(1208) : warning 204: symbol is assigned a value that is never used: "index" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors. |