So I have debugged my application and this is what the debugger told me:

At the line:
if(p_IS_TRUE(playerid,CHECK_INACTIVITY))
Which is defined as:
#define p_IS_TRUE(playerid,check) (p_CheckForStuff[playerid] & check)
So this is the important code:
//global
#define CHECK_SPAWNKILL (128) // 0000 0000 0000 0000 0000 0000 1000 0000
#define CHECK_INACTIVITY (256) // 0000 0000 0000 0000 0000 0001 0000 0000
#define CHECK_TELEPORT (512) // 0000 0000 0000 0000 0000 0010 0000 0000
#define CHECK_AIRBREAK (1024) // 0000 0000 0000 0000 0000 0100 0000 0000
unsigned long p_CheckForStuff[MAX_PLAYERS];
#define p_IS_TRUE(playerid,check) (p_CheckForStuff[playerid] & check)
list<int> PlayerLoopList;
//When a player connects
PlayerLoopList.push_back(playerid);
p_CheckForStuff[playerid] =-1;//enable all checks
//When a player disconnects
PlayerLoopList.remove(playerid);
//ProcessTick
int playerid = 0;
int ProcessTicksize = 0;
int ProcessTickindex = 0;
for (list <int>::iterator i = PlayerLoopList.begin(); i != PlayerLoopList.end(); ++i)
{
playerid = *i;
int playerstate = GetPlayerState(playerid);
int vid = GetPlayerVehicleID(playerid);
if(g_IS_TRUE(CHECK_INACTIVITY))
{
if(p_IS_TRUE(playerid,CHECK_INACTIVITY))
{
if(p_AcivityInfo[playerid].Reported == false)
{
and it can be reproduced as follow:
1) join the server
2) exit/ be kicked?
3) join again
4) crash
Does anyone know why this is happening? the code looks perfect to me..
Access Violations typically come from attempts to read through null pointers or uninitialized pointers or read off the end of an array.
In this case, you are reading an array value, so it would appear likely that the
playeridvalue is greater than or equal to theMAX_PLAYERSbound of the array.