[AJUDA]Salvar e Visualizar nomes in-game [DINI] -
†♥† - 18.11.2010
pawn Code:
if(strcmp(cmd,"/colocaradmin",true)==0)
{
if(PlayerInfo[playerid][pAdmin] >= 1339)//
{
new file[300];
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USE: /colocaradmin [Nick]");
return 1;
}
format(file, sizeof(file), "/listaadmin/%s.ini", tmp);
if(!fexist(file))
{
dini_Create(file);
SendClientMessage(playerid, COLOR_YELLOW,"Admin colocado com sucesso");
new plrIP[16];
if(IsPlayerConnected(playerid))
{
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
format(file, sizeof(file), "/listaadmin/%s.ini", plrIP);
if(!fexist(file))
{
dini_Create(file);
}
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD1,"Este nick ja esta em nossa lista de adm!!!");
}
}
return 1;
}
Ai й o seguinte, quando eu escrevo esse comando e o nick, ele cria um arquivo na pasta com o nick, mas minha duvida й a seguinte:
Se eu digitar o comando 2 vezes com nicks direfentes ele vai criar 2 arquivos, como que eu faзo pra em vez de criar um monte de arquivos os nicks ficar armazenados em 1 sу arquivo?
Pra eu poder usar um comando +/- /listaadmin
e aparecer todos os nicks que ta no arquivo?
Re: [AJUDA]Salvar e Visualizar nomes in-game [DINI] -
HigorOliver_ - 18.11.2010
Exemplo para Ler os nomes :
pawn Code:
format(string, sizeof(string), "%s",dini_Get("Arquivo", "Linha") );
SendClientMessage(playerid, color, string);
Agora para salvar
pawn Code:
if(PlayerInfo[playerid][pAdmin] >= 1339)//
{
dini_IntSet("Diretorio","Admins", PlayerName(playerid));
}
+ ou - Assim agora basta adaptar.
Re: [AJUDA]Salvar e Visualizar nomes in-game [DINI] -
†♥† - 18.11.2010
Se eu nгo tiver pedindo muito, alguйm poderia colocar isso dentro do comando pra mim?
Esse de ler e o de salvar?
Vlw
Re: [AJUDA]Salvar e Visualizar nomes in-game [DINI] -
zSuYaNw - 18.11.2010
pawn Code:
if(strcmp(cmdtext,"/Leleelelelelele", true) == 0)
{
new string[128];
format(string, sizeof(string), "%s",dini_Get("Arquivo", "Linha") );
SendClientMessage(playerid, color, string);
return 1;
}
if(strcmp(cmdtext,"/lolololololo", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1339) dini_IntSet("Diretorio","Admins", PlayerName(playerid));
return 1;
}