seanybob Posted April 3, 2007 Share Posted April 3, 2007 in my battletent, no matter what I do, only one npc will show at a time. say I make 2 npcs. We will call them npcA and npcB. both are added to the battletent. If i go to battletent.php (in game), I see npcA there, but npcB is nowhere to be found. However, if I remove npcA from the battletent, then return to battletent.php, I can see npcB (but naturally npcA is gone) it's friggin weird... lol (version 2.0 code) Quote Link to comment Share on other sites More sharing options...
UCC Posted April 3, 2007 Share Posted April 3, 2007 Re: battletent - only one npc showing at a time I vaguely remember this problem. Does your query look like this? $q=$db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid=$userid LEFT JOIN cities cy ON u.location=cy.cityid ORDER BY cb.cb_npcid"); If that doesn't help, let me know. I can send you my working code. Quote Link to comment Share on other sites More sharing options...
seanybob Posted April 3, 2007 Author Share Posted April 3, 2007 Re: battletent - only one npc showing at a time I vaguely remember this problem. Does your query look like this? $q=$db->query("SELECT cb.*,u.*,c.npcid,cy.cityname FROM challengebots cb LEFT JOIN users u ON cb.cb_npcid=u.userid LEFT JOIN challengesbeaten c ON c.npcid=u.userid AND c.userid=$userid LEFT JOIN cities cy ON u.location=cy.cityid ORDER BY cb.cb_npcid"); If that doesn't help, let me know. I can send you my working code. that was the exact query I had (except for the order by at the end) ya, still doesn't work just by adding the order by to it... UCC, I will give you the biggest hug in the world if you can tell me whats wrong with it ;) Quote Link to comment Share on other sites More sharing options...
CraigF Posted April 3, 2007 Share Posted April 3, 2007 Re: battletent - only one npc showing at a time UCC, I will give you the biggest hug in the world if you can tell me whats wrong with it ;) I want a hug :) please? :P My game is not up and running for a few days, when you get v1 codes does it have this problem as well? i know this is v2, but im just wondering, is it the same for v1 as it is for v2 with the battletent mod Quote Link to comment Share on other sites More sharing options...
seanybob Posted April 3, 2007 Author Share Posted April 3, 2007 Re: battletent - only one npc showing at a time This is a long shot, But i seen a game with a problem like this with there jail.php When you have 2 check the very bottom of the page to see if it hasnt "Fell" out of the table. That was the issue there, The table was ending before it should so would only list 1 at a time and throw any more above the first somewhere else on the screen which was hard to notice. hehe, nope not this time. I have had that happen to me before, think it was in jail/hospital as well, i probably spent an hour trying to fix it before i noticed that Quote Link to comment Share on other sites More sharing options...
UCC Posted April 3, 2007 Share Posted April 3, 2007 Re: battletent - only one npc showing at a time I sent the code to your Gmail account. You can compare what you have to my working version. Hope it helps. Quote Link to comment Share on other sites More sharing options...
seanybob Posted April 3, 2007 Author Share Posted April 3, 2007 Re: battletent - only one npc showing at a time I sent the code to your Gmail account. You can compare what you have to my working version. Hope it helps. UCC you're a genius... so i was examining that complex query, when I noticed what was friggin wrong... two queries to the database that needed to work together in tandem had the same name ($q) just change one of them to $q2 (like you did) and it works fine for v2, here is fix --------------------- find $q=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v"); $times=$db->fetch_single($q); change to $q2=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v"); $times=$db->fetch_single($q2); Thanks again UCC *hugs* Quote Link to comment Share on other sites More sharing options...
Z?v?? Posted April 7, 2007 Share Posted April 7, 2007 Re: battletent - only one npc showing at a time Thanks, that helped me out alot too. :-) Quote Link to comment Share on other sites More sharing options...
Stew Posted June 19, 2007 Share Posted June 19, 2007 Re: battletent - only one npc showing at a time I want to thank you guys for having this on the boards!! Thanks for the help!! Quote Link to comment Share on other sites More sharing options...
YoungGold Posted July 16, 2007 Share Posted July 16, 2007 Re: battletent - only one npc showing at a time jeese man ive been trying to figure that out for bloomin ages and yet it takes jsut two seconds to hop in here and find out the problem and fix it i love CE so much its also wierd because i saw the same bit of code in another post solving that error so i slapped my self round the head thinking why didn't i try that :roll: Quote Link to comment Share on other sites More sharing options...
thcmisty Posted October 10, 2007 Share Posted October 10, 2007 Re: battletent - only one npc showing at a time ye i had that prob but i the fix and now it only shows 2 npcs and no more but i have 4 what could be wrong Quote Link to comment Share on other sites More sharing options...
Godhand Posted October 12, 2007 Share Posted October 12, 2007 Re: battletent - only one npc showing at a time maybe its because $q2=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v"); $times=$db->fetch_single($q2); the q2. Try changing that to $q4=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v"); $times=$db->fetch_single($q4); Disclaimer- this is just a thought get a back up of the right stuff first. (lmao) Quote Link to comment Share on other sites More sharing options...
parelem Posted October 18, 2007 Share Posted October 18, 2007 Re: battletent - only one npc showing at a time this gives me an error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query was SELECT count(*) FROM challengesbeaten WHERE npcid= changed $q2=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$v"); $times=$db->fetch_single($q2); to $q2=$db->query("SELECT count(*) FROM challengesbeaten WHERE npcid=$userid"); $times=$db->fetch_single($q2); and it works Quote Link to comment Share on other sites More sharing options...
Vyp3r2oo9 Posted October 18, 2007 Share Posted October 18, 2007 Re: battletent - only one npc showing at a time UCC, Can you send me the battletent code too? Thanks :) Quote Link to comment Share on other sites More sharing options...
Scylla Posted March 6, 2008 Share Posted March 6, 2008 Re: battletent - only one npc showing at a time thanks for the fix on this one... i also was going batty......and the scripts were paid for.... so somethings are sometimes missed....but thanks again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.