[DINI 1.6] Not correctly working? I really need help with this, please. -
Facuarg - 08.03.2010
Hello, I'm Facu.
Since I started with Dini 1.6 I've been having problems, but not errors, my gamemode is clean of warnings and errors but sometimes, when I tell the gamemode to save something into a player's dini file, it just doesn't. I will show you.
Код:
if (strcmp(cmd, "/setadmin",true)==0)
{
new player[MAX_PLAYER_NAME];
if(IsPlayerAdmin(playerid))
{
cmd = strtok(cmdtext, idx);
new tmp[256];
new giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
//new playername[MAX_PLAYER_NAME];
new string[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, color_rojo_03, "|| Try [/setadmin] [playerid] [level]");
new level = strval(tmp);
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, color_rojo_03, "|| El ID introducido es invбlido.");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
PlayerInfo[giveplayerid][pAdmin] = level;
printf("|||||| [ADMIN] %s hiso a %s administrador nivel %d. ||||||", player, giveplayer, level);
format(string, sizeof(string), "|| Admin %s seted your admin level to %d.",player, level);
SendClientMessage(giveplayerid, color_aqua, string);
format(string, sizeof(string), "|| You have asigned %s the %d administration level.", giveplayer, PlayerInfo[giveplayerid][pAdmin]);
SendClientMessage(playerid, color_aqua, string);
return 1;
}
else
{
SendClientMessage(playerid, color_rojo_03," You are not logged in on RCON.");
}
So, lets see.
Old (example): Facuarg.ini file:
Password=1231231123
Admin=0
New Facuarg.ini file: (after the /setadmin on Facuarg)
Password=1231231123
Admin=0
Nothing changed! My dini is not just failing at this command, it's failing in a lot of functions and I really really need help with this. Am I doing it wrong? I must be doing it wrong. I just can't figure out how to do it right.
An other command that's failing too:
Код:
if (strcmp(cmd, "/setleader",true)==0)
{
new player[MAX_PLAYER_NAME];
if(IsPlayerAdmin(playerid))
{
cmd = strtok(cmdtext, idx);
new tmp[256];
new giveplayer[MAX_PLAYER_NAME];
new giveplayerid;
//new playername[MAX_PLAYER_NAME];
new string[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, color_rojo_03, "|| trye [/setleader] [playerid] [faction].");
new level = strval(tmp);
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, color_rojo_03, "|| Wrong ID");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
PlayerInfo[giveplayerid][pLider] = level;
printf("|||||| [ADMIN] %s hiso a %s lнder de la facciуn %d. ||||||", player, giveplayer, level);
format(string, sizeof(string), "|| Admin %s has made you leader of faction number %d.",player, level);
SendClientMessage(giveplayerid, color_aqua, string);
format(string, sizeof(string), "|| You have asigned %s the faction number %d leadership.", giveplayer, PlayerInfo[giveplayerid][pLeader]);
SendClientMessage(playerid, color_aqua, string);
return 1;
}
The codes are not well aliniated so I will upload an image of the first code.
Thanks you very much.
Re: [DINI 1.6] Not correctly working? I really need help with this, please. -
csabesz - 13.04.2010
But where is the dini used,or file saving or something.I don't see any file saving,or dini command.
Re: [DINI 1.6] Not correctly working? I really need help with this, please. -
biltong - 13.04.2010
Yeah, you realise you actually have to tell dini to do something, before it does it? Put dini_IntSet("name of file here", "whatever you name the key here", the level you set here); in there. Honestly, that's a stupid mistake, no offense.