MY admin script not updateing. -
Rokzlive - 29.12.2010
Ok, i have a custom admin script and it has a problem.
It runs with dini, and saves users account info to scriptfiles/users/username.ini (like rokzlive.ini)
It has a bug tho, it does not update the accounts.
If i /setlevel ingame, or /setcash, it does not save, when i player gets money, it does not save, nothing saves. Is there any way i can make a timer that every 5 minutes it updates, and when they logoff it updates?
Here are my .ini feilds.
hashPW=
password=
level=
score=
money=
joins=
deaths=
kills=
Kicks=
vip=
disabled=
Can anyone help?
Re: MY admin script not updateing. -
Grim_ - 29.12.2010
We will need to see some code to find your problem.
And do not use dini, it is outdated and inefficient.
Re: MY admin script not updateing. -
Rokzlive - 29.12.2010
Ima use mysql as soon as i can, but i dont know what you need to see. And they guy that helped me make this told me not to release it. What kind of thing do you need to see?
Re: MY admin script not updateing. -
Rokzlive - 29.12.2010
Heres my onplayerconnect and onplayerdisconnect feilds, can you help me with that?
pawn Код:
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
playerdata[playerid][allowteleport] = 0;
playerdata[playerid][blockpm] = 0;
playerdata[playerid][seepms] = 0;
playerdata[playerid][playerwired] = 0;
playerdata[playerid][level] = 0;
playerdata[playerid][pWarnings]=0;
playerdata[playerid][PlayerWired]=0;
playerdata[playerid][logged] = 0;
playerdata[playerid][Joins]=0;
playerdata[playerid][Deaths]=0;
playerdata[playerid][Kills]=0;
playerdata[playerid][PlayerFrozen] = 0;
playerdata[playerid][Kicks]=0;
playerdata[playerid][vip]=0;
playerdata[playerid][disabled]=0;
new s[128];
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "/Users/%s.ini", pname);
if(!fexist(file))
{
format(s, sizeof(s),"%s is not registered.\nPlease enter a password below.", pname);
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Please Register",s,"Register","Disconnect");
}
if(fexist(file))
{
format(s, sizeof(s), "%s is registered.\nPlease Login.", pname);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Please Login",s,"Login","Disconnect");
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
pSpectating[playerid][i]=0;
}
ranka[playerid] = Create3DTextLabel("Trucker",COLOR_YELLOW,30.0,40.0,50.0,40.0,0);
rankb[playerid] = Create3DTextLabel("Dispatch",COLOR_GREEN,30.0,40.0,50.0,40.0,0);
rankc[playerid] = Create3DTextLabel("Recovery",COLOR_RED,30.0,40.0,50.0,40.0,0);
rankd[playerid] = Create3DTextLabel("Police",COLOR_BLUE,30.0,40.0,50.0,40.0,0);
GameTextForPlayer(playerid,"~w~Rokzlive ~r~Transportation Nation",5000,5);
SendClientMessage(playerid, COLOR_GREEN, "Welcome! Choose your spawn! Type /menu to learn how to use our server! Type /rules to see rules!");
TextDrawShowForPlayer(playerid,Name);
TextDrawShowForPlayer(playerid,Web);
M_OnPlayerConnect(playerid);
new string[100];
format(string, sizeof(string),"To start a mission type /work");
TextDrawShowForPlayer ( playerid, mission [ playerid ] );
TextDrawSetString(mission [ playerid ],string);
SPEEDOS[playerid] = TextDrawCreate(10.0,200.0," ");
TextDrawShowForPlayer(playerid,SPEEDOS[playerid]);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"%s.ini",name);
if(!fexist(file))
{
dini_Create(file);
dini_IntSet(file,"Bank", PlayerInfo[playerid][Bank]);
}
if(fexist(file))
{
PlayerInfo[playerid][Bank] = dini_Int(file,"Bank");
}
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
Delete3DTextLabel(ranka[playerid]);
Delete3DTextLabel(rankb[playerid]);
Delete3DTextLabel(rankc[playerid]);
Delete3DTextLabel(rankd[playerid]);
M_OnPlayerDisconnect(playerid);
new file[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"%s.ini",name);
if(fexist(file))
{
dini_IntSet(file,"Bank", PlayerInfo[playerid][Bank]);
}
return 1;
}
Re: MY admin script not updateing. -
Mean - 29.12.2010
You need to find your defines that will look something like this:
pawn Код:
#define ScoreSaving true
#define MoneySaving true
just an example, it's not necesarily the same.
Re: MY admin script not updateing. -
Rokzlive - 29.12.2010
What?
Re: MY admin script not updateing. -
Vince - 29.12.2010
Quote:
Originally Posted by Rokzlive
saves users account info to scriptfiles/users/username.ini
|
According to your script: no, it doesn't.
pawn Код:
format(file,sizeof(file),"%s.ini",name);
This just saves the file in the scriptfiles folder.