<?php

$e = mysql_query("SELECT * FROM `us_quest` WHERE `user`='$uid' and `kill`>=`need`");
$w = mysql_num_rows($e);
if($w>='10'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='12'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='12'");
    }
}

$e = mysql_num_rows(mysql_query("SELECT * FROM `likes` WHERE `user`='$uid'"));
if($e>='5'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='11'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='11'");
    }
} 

$e = mysql_query("SELECT * FROM `payments` WHERE `v1`='$uid' and `sum`>='100'");
$w = mysql_num_rows($e);
if($w>='1'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='10'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='10'");
    }
}

$e = mysql_num_rows(mysql_query("SELECT * FROM `opp_last` WHERE `kill`='$uid'"));
if($e>='5'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='9'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='9'");
    }
} 

$e = mysql_num_rows(mysql_query("SELECT * FROM `opp_last` WHERE `uron`='$uid'"));
if($e>='10'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='8'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='8'");
    }
}

if($user['level']>='40'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='6'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='6'");
    }
}

if($user['level']>='30'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='5'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='5'");
    }
}

if($user['level']>='20'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='4'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='4'");
    }
}

if($user['level']>='10'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='3'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='3'");
    }
}

if($user['level']>='3'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='2'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='2'");
    }
}

if($user['mobkill']>='1000'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='7'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='7'");
    }
}

if($user['mobkill']>='100'){
    $q = mysql_num_rows(mysql_query("SELECT * FROM `us_achievements` WHERE `user`='$uid' and `ach_id`='1'"));
    if($q=='0'){
        mysql_query("INSERT INTO `us_achievements` SET `user`='$uid',`ach_id`='1'");
    }
}