<!--#include file="../inc.asp"-->
<!--#include file="../ydzq.asp"-->
<!--#include file="conn.asp"-->



<%


call head()
Call cardgame("挑战吹牛",yanse6)

dim id,num,idss
idss=Request("idss")
id=Request("id")
num=Request("num")
if id="" or Isnumeric(id)=false then
call error("ID无效！")
end if
if num="" or Isnumeric(num)=false then
call error("选择无效！")
end if
num=clng(num)
if num<>1 and num<>2 then
call error("选择无效！")
end if
if idss=""&myid&"" or Isnumeric(num)=false then
call error("你不能挑战自己哦,让别人去挑战！")
end if
set rs=Server.CreateObject("ADODB.Recordset")
  sql="select * from YD_jd where id=" & id & " and op=0 order by id desc"
  rs.open sql,ydzqconn,1,2
if rs.eof then
response.write "出错了，本次吹牛已经结束！再去<a href=""index.asp?saytk="&saytk&"&amp;sid="&sid&""">抢一个</a>吹牛来玩！"
Elseif myjb<rs("paycent") then
response.write "对不起!您的"&getcent&"不足!再去<a href=""index.asp?saytk="&saytk&"&amp;sid="&sid&""">抢一个</a>小下注额的吹牛来玩！"
Else

rs("reuseid")=myid
rs("op")=1
rs("num1")=num
rs.update()

 dim about3
 if rs("num")=1 then
 about3=rs("about1")
 else
 about3=rs("about2")
 end if
'----------------------------------------------
if rs("num")<>num then
payjdcent=abs(int(rs("paycent")*paylulu))
  conn.Execute"update users set myjb=myjb+ " & abs(rs("paycent")+payjdcent) & "  Where id=" & rs("useid") 
  addlist(rs("useid"))
  conn.Execute"update users set myjb=myjb- " & rs("paycent") & "  Where id=" &myid
  addlist2(myid)


 response.write "很遗憾，正确答案是第"&rs("num")&"个:”"&about3&"“，本次挑战，你输了" & rs("paycent") & getcent&"" 

            ltlyuan="你的吹牛：" & rs("about") & "被会员:[" & myni & "ID:" & myid & "]挑战,你吹牛正确答案：”" & about3 & "“，恭喜您，对方被您骗了！本次说吹牛你赢了" & rs("paycent") & getcent&"!"
else
payjdcent=abs(int(rs("paycent")*paylulu2))

  addlist2(rs("useid"))
  conn.Execute"update users set myjb=myjb+ "&payjdcent&"  Where id=" &myid
  addlist(myid)
 response.write "恭喜你，正确答案是第"&rs("num")&"个:"&about3&"，本次挑战，你赢了"&rs("paycent") & getcent&"<br/>" 
 



            ltlyuan="你的吹牛：" & rs("about") & "被会员:[" & myni & "ID:" & myid & "]挑战,你吹牛正确答案：”" & about3 & "“，很不幸，您骗不了对方，本次说吹牛你输了" & rs("paycent") & getcent&"!"
end if
dim id1
id1=rs("useid")
end if
'-------------------------------------------------- 

rs.close
set rs=nothing

'发信
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from guest",conn,1,2
rs.addnew
rs("fnr")=ltlyuan
rs("sid")=id1
rs("fid")=0
rs.update
rs.close
set rs=nothing
ydzqconn.close
set ydzqconn=nothing
conn.close
set conn=nothing
%>
<br/>-------------
<!--#include file="fanhui.asp"-->

<%
call headsay()
%>
