Command problem
#7

pawn Код:
CMD:agetlastlogin(playerid,params[])
{
    if(PlayerData[playerid][AdminLevel] < 2) return 0;
    if(sscanf(params,"s[24]",agetlast)) return SCM(playerid,grey,"USAGE: /getlastlogin [Player Name]");
    CheckMySQL();
    format(str,sizeof(str),"SELECT * FROM accounts WHERE Name = '%s'",agetlast);
    mysql_query(str);
    mysql_store_result();
    if(mysql_num_rows() != 0)
    {
        mysql_fetch_row_format(row, "|");//You forgot to fetch the row...
        explode(row,field, "|");//...and explode it.
        format(str,sizeof(str),"Name: {FF9900}%s",agetlast);
        SCM(playerid,-1,str);
        format(str,sizeof(str),"Date: {FF9900}%s %d %d",Months[strval(field[42]) - 1],strval(field[43]),strval(field[41]));
        SCM(playerid,-1,str);
        format(str,sizeof(str),"Time: {FF9900}%d:%d",strval(field[44]),strval(field[45]));
        SCM(playerid,-1,str);
    }
    else
    {
        SCM(playerid,red,"ERROR: That account does not exist.");
    }
    mysql_free_result();
    return 1;
}
Reply


Messages In This Thread
Command problem - by Tanush123 - 08.02.2012, 02:46
Re: Command problem - by Tanush123 - 10.02.2012, 21:27
Re: Command problem - by Nonameman - 10.02.2012, 21:52
Re: Command problem - by Twisted_Insane - 10.02.2012, 21:54
Re: Command problem - by Tanush123 - 11.02.2012, 22:38
Re: Command problem - by Tee - 11.02.2012, 23:04
Re: Command problem - by Tee - 11.02.2012, 23:09

Forum Jump:


Users browsing this thread: 1 Guest(s)