Dini_IntSet -
DownGrade - 27.01.2014
Quando faz o comando, ele nгo cria nada na .ini do jogador, ele nunca cria, alguйm me ajuda ?
pawn Код:
if(strcmp(cmd, "/setarpolicial", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xC4C4FFAA, "Uso: /setarpolicial [id]");
return 1;
}
new id = strval(tmp);
if(!IsPlayerConnected(id))
{
SendClientMessage(playerid, COR_BRANCO, "(ERRO) Jogador nгo conectado!");
return 1;
}
new conta[128], str[256];
new comandante[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, comandante, sizeof(comandante));
format(conta, sizeof(conta), "contas/usuarios/%s.ini", tmp);
dini_IntSet(conta, "Policial", 1); //LINHA QUE NГO SETA Policial = 1 na conta...
format(str, sizeof(str), "(INFO) Vocк setou o jogador %s de policial com sucesso!", nome(id));
SendClientMessage(playerid, 0xC0FF3EAA, str);
format(str, sizeof(str), "(INFO) O comandante %s setou vocк de policial, agora vocк pode pegar as profissхes da policia!", comandante);
SendClientMessage(playerid, 0xC0FF3EAA, str);
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "(ERRO) Vocк nгo й um comandante ou corregedor!");
}
return 1;
}
Re: Dini_IntSet -
davi54723 - 27.01.2014
contas/usuarios/%s.ini
Tem a pasta ? (Contas> Usuarios)
Re: Dini_IntSet -
DownGrade - 27.01.2014
Sim.
Re: Dini_IntSet -
lHesoyaml - 28.01.2014
Use DOF2.
Re: Dini_IntSet -
FrostyWolf - 28.01.2014
Tentei arrumar mas nгo sei se consegui, faзa um teste:
pawn Код:
if(strcmp(cmd, "/setarpolicial", true) == 0)
{
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, 0xC4C4FFAA, "Uso: /setarpolicial [id]");
return 1;
}
new id = strval(tmp);
if (!IsPlayerConnected(id))
{
SendClientMessage(playerid, COR_BRANCO, "(ERRO) Jogador nгo conectado!");
return 1;
}
new conta[128], str[256];
new comandante[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, comandante, sizeof(comandante));
format(conta, sizeof(conta), "contas/usuarios/%s.ini", comandante); // Alterado
dini_IntSet(conta, "Policial", 1);
format(str, sizeof(str), "(INFO) Vocк setou o jogador %s de policial com sucesso!", nome(id));
SendClientMessage(playerid, 0xC0FF3EAA, str);
format(str, sizeof(str), "(INFO) O comandante %s setou vocк de policial, agora vocк pode pegar as profissхes da policia!", comandante);
SendClientMessage(playerid, 0xC0FF3EAA, str);
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "(ERRO) Vocк nгo й um comandante ou corregedor!");
}
}
Re: Dini_IntSet -
Dolby - 28.01.2014
Vocк formatou com
tmp, sendo que ela й o ID do jogador em forma de string.
pawn Код:
format(conta, sizeof(conta), "contas/usuarios/%s.ini", comandante);
Re: Dini_IntSet -
Schocc - 28.01.2014
Usou antes ??
pawn Код:
dini_Create(conta);
// Aonde 'conta' representa o local de salvamento dos dados para cada conta registrada.
Creio que o arquivo nгo existe, sendo assim a funзгo retorna false.
@Dica: Use a include DOF2, utilize DINI somente para estudos mesmo.