Dini crash my server sometimes..
#1

After I updated my server to sa-mp 0.3 it did start to rondomly crash. After some debuging I found the problem, and it's something whit's dini. Take a look on my code and the last thing in the log and you will see that the server crash when using dini but not always...


It have crashed 4 times now... And here is the last thing in the log:
Crash 1: [14:34:51] [Save] Nr:28
Crash 2: [15:41:12] [Save] Nr:55
Crash 3: [15:50:10] [Save] Nr:20
Crash 4: [17:29:12] [Save] Nr:50


Code:
pawn Код:
public Save(playerid)
{
    print("[Save] Nr:1");
    if (ForceLogin[playerid] == 0 && Spawned[playerid] == 1)
    {
    print("[Save] Nr:2");
    new file[128]; format(file,sizeof(file),"/Users/%s.ini",PlayerName(playerid));
    print("[Save] Nr:3");
    PlayerScoree[playerid] = GetPlayerScore(playerid);
    print("[Save] Nr:4");
    moneyy[playerid] = GetPlayerCash(playerid);
    print("[Save] Nr:5");
    GetPlayerHealth(playerid,Liv[playerid]);
    print("[Save] Nr:6");
    GetPlayerArmour(playerid,Skyd[playerid]);
    print("[Save] Nr:7");
    vert[playerid] = GetPlayerVirtualWorld(playerid);
    print("[Save] Nr:8");
    GetPlayerPos(playerid,Posxyz[playerid][0],Posxyz[playerid][1],Posxyz[playerid][2]);
    print("[Save] Nr:9");
    new Float:x, Float:y, Float:z;
    print("[Save] Nr:10");
    GetPlayerPos(playerid, x, y, z);
    print("[Save] Nr:11");
    posint[playerid] = GetPlayerInterior(playerid);
    print("[Save] Nr:12");
    dini_IntSet(file,"saveed2",1);
    print("[Save] Nr:13");
    dini_IntSet(file,"saveed",ServerSave);
    print("[Save] Nr:14");
    dini_IntSet(file,"Score",PlayerScoree[playerid]);
    print("[Save] Nr:15");
    dini_IntSet(file,"Killed",killed[playerid]);
    print("[Save] Nr:16");
    dini_IntSet(file,"Killer",killer[playerid]);
    print("[Save] Nr:17");
    dini_IntSet(file,"money",moneyy[playerid]);
    print("[Save] Nr:18");
    dini_FloatSet(file,"x",Posxyz[playerid][0]);
    print("[Save] Nr:19");
    dini_FloatSet(file,"y",Posxyz[playerid][1]);
    print("[Save] Nr:20");
    dini_FloatSet(file,"z",Posxyz[playerid][2]);
    print("[Save] Nr:21");
    dini_IntSet(file,"int",posint[playerid]);
    print("[Save] Nr:22");
    dini_IntSet(file,"vert",vert[playerid]);
    print("[Save] Nr:23");
    dini_IntSet(file,"Stad",Stad[playerid]);
    print("[Save] Nr:24");
    dini_IntSet(file,"Boat",iSpawnSet[playerid]);
    print("[Save] Nr:25");
    dini_FloatSet(file,"liv",Liv[playerid]);
    print("[Save] Nr:26");
    dini_FloatSet(file,"skydd",Skyd[playerid]);
    print("[Save] Nr:27");
    dini_IntSet(file,"bombs",bombs[playerid]);
    print("[Save] Nr:28");                //The last thing in the log is "[14:34:51] [Save] Nr:28"
    dini_IntSet(file,"robb",pengar[playerid]);   //So the problem shuld be this.. And pengar[playerid] shuld be 0...
    print("[Save] Nr:29");
    dini_IntSet(file,"allowcar",allowcar[playerid]);
    print("[Save] Nr:30");
    dini_IntSet(file,"allowplay",allowplay[playerid]);
    print("[Save] Nr:31");
    dini_IntSet(file,"regular",regular[playerid]);
    print("[Save] Nr:32");
    dini_IntSet(file,"santicoler",anticoler[playerid]);
    print("[Save] Nr:33");
    if(DB[playerid] == 0)
    {
    print("[Save] Nr:34");
    GetPlayerWeaponData(playerid,1,weap0,ammo0);// Smal weps
    print("[Save] Nr:35");
    GetPlayerWeaponData(playerid,2,weap1,ammo1);// hand gun
    print("[Save] Nr:36");
    GetPlayerWeaponData(playerid,3,weap2,ammo2);//shotgun
    print("[Save] Nr:37");
    GetPlayerWeaponData(playerid,4,weap3,ammo3);// SMG
    print("[Save] Nr:38");
    GetPlayerWeaponData(playerid,5,weap4,ammo4);// AK47 / M4
    print("[Save] Nr:39");
    GetPlayerWeaponData(playerid,6,weap5,ammo5);// rifle
    print("[Save] Nr:40");
    GetPlayerWeaponData(playerid,7,weap6,ammo6);// rocket launcher
    print("[Save] Nr:41");
    GetPlayerWeaponData(playerid,8,weap7,ammo7);
    print("[Save] Nr:42");
    GetPlayerWeaponData(playerid,9,weap8,ammo8);
    print("[Save] Nr:43");
    GetPlayerWeaponData(playerid,10,weap9,ammo9);
    print("[Save] Nr:44");
    GetPlayerWeaponData(playerid,11,weap10,ammo10);
    print("[Save] Nr:45");
    dini_IntSet(file,"weap0",weap0); dini_IntSet(file,"weap0ammo",ammo0);
    print("[Save] Nr:46");
    dini_IntSet(file,"weap1",weap1); dini_IntSet(file,"weap1ammo",ammo1);
    print("[Save] Nr:47");
    dini_IntSet(file,"weap2",weap2); dini_IntSet(file,"weap2ammo",ammo2);
    print("[Save] Nr:48");
    dini_IntSet(file,"weap3",weap3); dini_IntSet(file,"weap3ammo",ammo3);
    print("[Save] Nr:49");
    dini_IntSet(file,"weap4",weap4); dini_IntSet(file,"weap4ammo",ammo4);
    print("[Save] Nr:50");
    dini_IntSet(file,"weap5",weap5); dini_IntSet(file,"weap5ammo",ammo5);
    print("[Save] Nr:51");
    dini_IntSet(file,"weap6",weap6); dini_IntSet(file,"weap6ammo",ammo6);
    print("[Save] Nr:52");
    dini_IntSet(file,"weap7",weap7); dini_IntSet(file,"weap7ammo",ammo7);
    print("[Save] Nr:53");
    dini_IntSet(file,"weap8",weap8); dini_IntSet(file,"weap8ammo",ammo8);
    print("[Save] Nr:54");
    dini_IntSet(file,"weap9",weap9); dini_IntSet(file,"weap9ammo",ammo9);
    print("[Save] Nr:55");
    dini_IntSet(file,"weap10",weap10); dini_IntSet(file,"weap10ammo",ammo10);
    print("[Save] Nr:56");
    }
    print("[Save] Nr:57");
    }
    print("[Save] Nr:58");
    return 1;
}

Sorry for my bad English.
Reply
#2

Make sure you re-compile your gamemode with the new 0.3 includes and such.

Also, if you have any filterscripts, you need to do the same.
Reply
#3

Quote:
Originally Posted by www.trueroleplay.com
Make sure you re-compile your gamemode with the new 0.3 includes and such.

Also, if you have any filterscripts, you need to do the same.
Im not an noob-_- I have already done that and the server works fine but after some time it just crash at the save funktion for some unknown reason... And I can be the only player on the server and brb = no changes in the varibles.. and still it crash just rondomly...
Reply
#4

Are you sure it's not an other timer or something which crashes it?
Reply
#5

Quote:
Originally Posted by Marcel
Are you sure it's not an other timer or something which crashes it?
Yes im sure the last thing in the log was:

First time:
[15:41:12] [Save] Nr:55
Secound time:
[15:50:10] [Save] Nr:20

It should have been Nr: 58... So it means the server crashed before the save(playerid) Function was fhinished!
Reply
#6

What I mean is, your debug "script" stops at random numbers (55, 20). Are you sure there isn't another timer that runs at almost the same time. Or there is an other function that is being used which causes the crashes?
Reply
#7

Quote:
Originally Posted by Marcel
What I mean is, your debug "script" stops at random numbers (55, 20). Are you sure there isn't another timer that runs at almost the same time. Or there is an other function that is being used which causes the crashes?
You really doesn't understand? The server CRASH on SAVE(playerid); No it CAN'T be somewere else! Look at the log and the script... and you will see that it's crashing in Save(playerid);

The last part from the log file:
Код:
15:41:08] [AntiPositionHack] Nr:2
[15:41:09] [CheckSpeedo] Nr:1
[15:41:09] [CheckSpeedo] Nr:2
[15:41:09] [Everthing] Nr:1
[15:41:09] [CheckSpeedo] Nr:1
[15:41:09] [CheckSpeedo] Nr:2
[15:41:09] [CasUpdate] Nr:1
[15:41:09] [CasUpdate] Nr:2
[15:41:09] [BoatCheck] Nr:1
[15:41:09] [BoatCheck] Nr:2
[15:41:09] [CheckSpeedo] Nr:1
[15:41:09] [CheckSpeedo] Nr:2
[15:41:10] [AntiPositionHack] Nr:1
[15:41:10] [AntiPositionHack] Nr:2
[15:41:10] [AntiHack] Nr:1
[15:41:10] [AntiHack] Nr:2
[15:41:10] [RobanStats] Nr:1
[15:41:10] [CheckSpeedo] Nr:1
[15:41:10] [CheckSpeedo] Nr:2
[15:41:10] [CheckSpeedo] Nr:1
[15:41:10] [CheckSpeedo] Nr:2
[15:41:11] [AntiPositionHack] Nr:1
[15:41:11] [AntiPositionHack] Nr:2
[15:41:11] [BoatCheck] Nr:1
[15:41:11] [BoatCheck] Nr:2
[15:41:11] [CheckSpeedo] Nr:1
[15:41:11] [CheckSpeedo] Nr:2
[15:41:11] [CheckSpeedo] Nr:1
[15:41:11] [CheckSpeedo] Nr:2
[15:41:11] [Save] Nr:1
[15:41:11] [Save] Nr:2
[15:41:11] [Save] Nr:3
[15:41:11] [Save] Nr:4
[15:41:11] [Save] Nr:5
[15:41:11] [Save] Nr:6
[15:41:11] [Save] Nr:7
[15:41:11] [Save] Nr:8
[15:41:11] [Save] Nr:9
[15:41:11] [Save] Nr:10
[15:41:11] [Save] Nr:11
[15:41:11] [Save] Nr:12
[15:41:11] [Save] Nr:13
[15:41:11] [Save] Nr:14
[15:41:11] [Save] Nr:15
[15:41:11] [Save] Nr:16
[15:41:11] [Save] Nr:17
[15:41:11] [Save] Nr:18
[15:41:11] [Save] Nr:19
[15:41:11] [Save] Nr:20
[15:41:11] [Save] Nr:21
[15:41:11] [Save] Nr:22
[15:41:12] [Save] Nr:23
[15:41:12] [Save] Nr:24
[15:41:12] [Save] Nr:25
[15:41:12] [Save] Nr:26
[15:41:12] [Save] Nr:27
[15:41:12] [Save] Nr:28
[15:41:12] [Save] Nr:29
[15:41:12] [Save] Nr:30
[15:41:12] [Save] Nr:31
[15:41:12] [Save] Nr:32
[15:41:12] [Save] Nr:33
[15:41:12] [Save] Nr:34
[15:41:12] [Save] Nr:35
[15:41:12] [Save] Nr:36
[15:41:12] [Save] Nr:37
[15:41:12] [Save] Nr:38
[15:41:12] [Save] Nr:39
[15:41:12] [Save] Nr:40
[15:41:12] [Save] Nr:41
[15:41:12] [Save] Nr:42
[15:41:12] [Save] Nr:43
[15:41:12] [Save] Nr:44
[15:41:12] [Save] Nr:45
[15:41:12] [Save] Nr:46
[15:41:12] [Save] Nr:47
[15:41:12] [Save] Nr:48
[15:41:12] [Save] Nr:49
[15:41:12] [Save] Nr:50
[15:41:12] [Save] Nr:51
[15:41:12] [Save] Nr:52
[15:41:12] [Save] Nr:53
[15:41:12] [Save] Nr:54
[15:41:12] [Save] Nr:55
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)