 
 ////////////////////////
 //  Shows user stats  //
 ////////////////////////
 PokeDisplay(id, aid)
 {
	if ( !PMon() || !is_user_connected(id) || !is_user_connected(aid) ) return

	static message[256], iLen
	copy(message, 255, EMPTY)
	iLen = 0

	static pname[NAME_LENGTH], level
	if(PlayersSet[id][SET_HUD_PARTY] && !Safari()){
		for(new x=0; x<MAX_ACTIVE_POKES; x++){
			if(!PlayersPoke[aid][x])
				break
			iLen += formatex(message[iLen],(255-iLen),"%s(Lvl:%d)\n", PokeToName(PlayersPoke[aid][x]), PlayersLevel(aid, x))
		}
	}

	if(id != aid)
		iLen += formatex(message[iLen],(255-iLen)," HP: %d/%d  ", Health(aid), PlayerStat[aid][STAT_MAXHP])
	#if MOD==CS
	else if(Health(aid) > 255 || PlayerStat[aid][STAT_MAXHP] > 255)
		iLen += formatex(message[iLen],(255-iLen)," HP: %d/%d  ", Health(aid), PlayerStat[aid][STAT_MAXHP])
	#endif

	if(Pokemon[aid]){
		new temp[56], moneytemp[56]

		level = PlayersLevel(aid, PlayersActive[aid])
		PokeToName(Pokemon[aid], pname, NAME_LENGTH)

		if(BindUsed[aid]==WAIT_TIME)
			copy(temp,55,"Czekaj")
		else if(BindUsed[aid]>0.0)
			formatex(temp,55,"%.01f",BindUsed[aid]-get_gametime())
		else
			copy(temp,55,"Gotowy")

		#if MOD!=CS
			formatex(moneytemp,55," $%d",Money(aid))
		#else
			copy(moneytemp,55,EMPTY)
		#endif

		if(id==aid){
			if(Safari()){
				iLen += formatex(message[iLen],(255-iLen),"Pokemon: %s (Skl:%s)%s", pname, temp, moneytemp)
			}
			else{
				if( level >= TotalLevels )
					iLen += formatex(message[iLen],(255-iLen),"Pokemon: %s (Skl:%s Lvl:%d Exp:%d)%s", pname, temp, level, PlayersXP[id][PlayersActive[id]], moneytemp )
				else
					iLen += formatex(message[iLen],(255-iLen),"Pokemon: %s (Skl:%s Lvl:%d Exp:%d/%d)%s", pname, temp, level, PlayersXP[id][PlayersActive[id]], g_isWild[id]>0?PokeLevels[level]/2:PokeLevels[level], moneytemp )
			}
		}
		else {
			if(Safari())
				iLen += formatex(message[iLen],(255-iLen),"%s (Skl:%s)%s", pname, temp, moneytemp )
			else
				iLen += formatex(message[iLen],(255-iLen),"%s (Skl:%s Lvl:%d)%s", pname, temp, level, moneytemp )
		}
	}

	//for some reason, in NS it flashes, so were going to make it last longer
	#if MOD==NS
		set_hudmessage(255,255,0, 0.00, PlayersSet[id][SET_HUD_Y]*0.01, 0, 0.1, 1.5, 0.1, 0.1, -1)
	#else
		set_hudmessage(255,255,0, 0.00, PlayersSet[id][SET_HUD_Y]*0.01, 0, 0.1, 1.0, 0.1, 0.1, -1)
	#endif

	ShowSyncHudMsg( id, HUDSYNC, message )

	#if MOD!=CS
		pokemon_statustext(id)
	#endif
 }
 
 ////////////////////////////////////
 //  Displays Personal Info Again  //
 ////////////////////////////////////
 public self_view(id)
 {
	if(is_user_alive(id))
		fm_attach_view(id, id)
 }
 
 ///////////////////////////////////
 //  Every time someone connects  //
 ///////////////////////////////////
 public client_connect(id)
 {
	if(PM_disabled==1)
		return

	new i
	PlayersActive[id] = 0
	Pokemon[id] = 0
	for(i=0; i<MAX_POKES; i++){
		PlayersPoke[id][i] = 0
		PlayersXP[id][i] = 0
	}

	#if ALLOW_WILD==1
		if(get_ppcvar_num(pm_wild)>0)
			g_isWild[id] = 1
		else
			g_isWild[id] = 0
	#else
		g_isWild[id] = 0
	#endif
	#if POKERANK_SYSTEM==1
		PlayersCatch[id] = 0
	#endif

	money[id] = 0
	NoItems(id)
	for(i=0; i<MAX_ITYPE+3; i++){
		Open[id][i] = false
	}
	g_Connected[id] = 0
	debugMessage(id,4,"connected")
 }
 
 ///////////////////////////////////////////
 //  When somone is officially connected  //
 ///////////////////////////////////////////
 public client_putinserver(id)
 {
	if(PM_disabled==1)
		return
	debugMessage(id,2,"xp loaded (%s)", LoadXP(id)?"true":"false" );
 }
 
 //////////////////////////////////////
 //  Every time someone disconnects  //
 //////////////////////////////////////
 public client_disconnect(id)
 {
	if(PM_disabled==1)
		return

	if(SaveXPon())
		SaveXP(id)
	g_Connected[id] = 0
	debugMessage(id,4,"disconnected")
 }
 
 ///////////////////////////////////////
 //  Stops people from buying things  //
 ///////////////////////////////////////
 public EndBuying()
	CanBuy = false
 
 ///////////////////////////////////////////////////
 //  Stops people from moving during freeze time  //
 ///////////////////////////////////////////////////
 public EndFreezeTime()
 {
	FreezeTime = false
	new players[32], pnum
	poke_get_players(players, pnum, "a")
	for(new i=0; i<pnum; i++)
		SetSpeed(players[i])
 }
 