Nicholas Posted October 6, 2009 Share Posted October 6, 2009 hi does anyone know how to make it so you cant play the game until you voted. for example, you cant get on index, inventory, explore, jail, hospital, nothing... but voting page until you have voted for all voting sites? just wondering if you was possible since ive had quite few players just register play for like 5 minutes max and just go and never come back... reason why im asking is so, when new players come to the game and go i dont like this game after searching the game little bit, they have still voted and boosted my ranking up on the voting site board, if u know what i mean lol. hopefully someone can help me out :) Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted October 6, 2009 Share Posted October 6, 2009 This is for the header. Change the 5 to how ever many sites you have. $block = $db->query(sprintf("SELECT `userid` FROM `votes` WHERE `userid` = %u",abs(@intval($ir['userid'])))); if($db->num_rows($block) < 5) { header('Location: voting.php'); } Now they are stuck on the voting page LOL. If you want to tell them why, add this to the voting,php $block = $db->query(sprintf("SELECT `userid` FROM `votes` WHERE `userid` = %u",abs(@intval($ir['userid'])))); if($db->num_rows($block) < 5) { echo 'You can not leave this page until you have voted on all the sites.'; } And there ya go. Quote Link to comment Share on other sites More sharing options...
Nicholas Posted October 6, 2009 Author Share Posted October 6, 2009 This is for the header. Change the 5 to how ever many sites you have. $block = $db->query(sprintf("SELECT `userid` FROM `votes` WHERE `userid` = %u",abs(@intval($ir['userid'])))); if($db->num_rows($block) < 5) { header('Location: voting.php'); } Now they are stuck on the voting page LOL. If you want to tell them why, add this to the voting,php $block = $db->query(sprintf("SELECT `userid` FROM `votes` WHERE `userid` = %u",abs(@intval($ir['userid'])))); if($db->num_rows($block) < 5) { echo 'You can not leave this page until you have voted on all the sites.'; } And there ya go. umm... where abouts do you add these on header and voting pages? Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted October 7, 2009 Share Posted October 7, 2009 in header add after if(!$ir['email']) { global $domain; die ("<body>Your account may be broken. Please mail help@{$domain} stating your username and player ID."); } in voting just add where you want it to show, like at top after global Though i did just think about somethign, that wont work, it will send them into a endless loop lol. so try this on header $block = $db->query(sprintf("SELECT `userid` FROM `votes` WHERE `userid` = %u",abs(@intval($ir['userid'])))); $page = "/voting.php"; if($db->num_rows($block) < 5 && $_SERVER['SCRIPT_NAME'] != $page) { header('Location: voting.php'); } This is untested of course. Quote Link to comment Share on other sites More sharing options...
Nicholas Posted October 7, 2009 Author Share Posted October 7, 2009 it worked like a charm mate CHEERS! you was a great help :) 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.