02.02.2012, 21:36
Well i think i failed, i was trying to make a /getlastlogin command for organization leaders so that will show when was the last time the person was connected. It updates my mysql so i got no problem with mysql, i only got problem with this
it shows 0 0 for Date:
pawn Код:
CMD:getlastlogin(playerid,params[])
{
new pyear,pmonth;
if(PlayerData[playerid][Leader] == 0) return SCM(playerid,red,"ERROR: You are not an organization leader or co leader");
if(sscanf(params,"s[24]",pname)) return SCM(playerid,grey,"USAGE: /getlastlogin [Player Name]");
CheckMySQL();
format(str,sizeof(str),"SELECT * FROM accounts WHERE Name = '%s'",pname);
mysql_query(str);
mysql_store_result();
if(mysql_num_rows() != 0)
{
format(str,sizeof(str),"SELECT Year = %d,Month = %d WHERE Name '%s'",pyear,pmonth,pname);
mysql_query(str);
format(str,sizeof(str),"Name: {FF9900}%s",pname);
SCM(playerid,-1,str);
format(str,sizeof(str),"Date: {FF9900}%d %d",pmonth,pyear);
SCM(playerid,-1,str);
}
else
{
SCM(playerid,red,"ERROR: That name is not available");
}
return 1;
}