Jump to content

simplynice

Members
  • Posts

    128
  • Joined

  • Last visited

Everything posted by simplynice

  1. simplynice

    Php Math

    Uhmm..it seems that it's just getting the value of customer's budget but no exchange and total expenses so i made this: <?php include('dbconnect.php'); ?> <?php if(isset($_POST['total'])) { $id = $_POST['item_id']; $query_prices = mysql_query("SELECT * FROM add_parts WHERE item_id = '$id'") or die(mysql_error()); while($row = mysql_fetch_array($query_prices)) { $itemprice = $row['item_price']; $itemamount = $_POST['item_amount']; $customer = $_POST['customers_money']; $amount_to_pay = $itemprice * $itemamount; if($amount_to_pay > $customer) { echo "You dont have enough money."; die(); } $cash = $customer - $amount_to_pay; echo "Price per item: ".$itemprice; echo "<br/>Amount Due: ".$amount_to_pay; echo "<br/>Exchange: ".$cash; echo "<br/>Customer cash: ".$customer; } } ?> <?php $query = mysql_query("SELECT * FROM add_parts") or die(mysql_error()); while($row = mysql_fetch_array($query)) { $itemid = $row['item_id']; $itemname = $row['item_name']; $itemprice = $row['item_price']; ?> <form method="POST"> <input type="checkbox" name="item_id" id="item_id" value="<?php echo $itemid; ?>" /> <label><?php echo $itemname; ?> - Price [ Php <?php echo $itemprice; ?> ]</label><br/> <!-- <input type="hidden" name="hidden_price" id="" value="<?php echo $itemprice; ?>" /> --> <?php } ?> <input type="text" name="item_amount" id="" placeholder="Enter how many item" /><br/> <input type="text" name="customers_money" id="" placeholder="Customer's total money" /><br/><br/> <input type="submit" name="total" value="Total"/> </form> It works very fine although i can't select as much as i want. So if there's someone or anyone can help me out of this do as you please.
  2. simplynice

    Php Math

    I'll give it a try jaypee, thanks!
  3. simplynice

    Php Math

    Good day guys, i just want to ask about PHP math. I don't have any idea what to do with this stuff. So for example i'm selling 3 items [already stored this in mySQL/Database] each item has a value of $100 and the total money of the client is $500 i want to do the calculation using PHP script. So it will subtract the $300 into the client's money which is $500. So the total exchange is $200.. So now, i can do this in PHP in manual way but how about let the PHP do the job. Like i'll buy 6 items or so, and enter the total money i got. It will subtract automatically and tells me how much do i owe and how much do i get back. It's more like buying stuffs in a supermarket, paying it, giving you receipt. Total amount of what did you bought: Total exchange: Total money: Let me know if the explanation is so much complicated and thanks in advance.
  4. We're all hoping this will work NOW. -Congrats and Goodluck.
  5. This is better than @command: [/b][b]monster "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>"};[/b][b] Does it check if the map is being used?
  6. stable or trunk has the same database/sql format i guess. if it is so then it will never happen not unless you accidentally deleted one of the table/fields.
  7. IMO the current theme is fine. Clean.
  8. it would be easy defining it as to this: example: 1800000 <-- default time sc_start SC_WINDWALK,1800000,5; then set the time to what ever you set above.. 300 <-- default time if(@last_item_consumed+300 > gettimetick (2)) regarding src mod. i don't have any idea how to do it. And this thread should be here: http://eathena.net/board/forum/36-source-modification-requests/
  9. 25000,My_Item,My Item,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ if (@last_item_consumed+300 > gettimetick(2)) { dispbottom "You are not allowed to use this"; getitem 25000,1; end; } sc_start SC_CUSTOM_STATUS,1,0; set @last_item_consumed, gettimetick(2); end;},{},{} Just adjust the +300 if you want to extend the time in order not to be used by the players while the status is active. Got this code from Annie's megaphone.
  10. simplynice

    Rentitem

    How about telling the players how many days,hours and minutes if the set minutes/seconds is more than 24 hours if not then it would tell the players how many hours only so it wont be annoying seeing 0 days,3 hours, 5 mins and 24 seconds.
  11. Insted of this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> [color=#000088][font=monospace][size=2]<html[/size][/font][/color][color=#000000][font=monospace][size=2] [/size][/font][/color][color=#660066][font=monospace][size=2]xmlns[/size][/font][/color][color=#666600][font=monospace][size=2]=[/size][/font][/color][color=#008800][font=monospace][size=2]"http://www.w3.org/1999/xhtml"[/size][/font][/color][color=#000088][font=monospace][size=2]>[/size][/font][/color] Do this: <!DOCTYPE html>
  12. And i think we really need to change the button im not pushing what i have suggested its just that it is not fitted. Small, unreadable.
  13. Yes it's working but as intended its not if it is then it's not just selecting. Its selecting/copying and ready to be pasted.
  14. Instead of arguing standards and non-standards why don't WE,YOU (in general) grab a code so we can fix the copy to clipboard/select text button.
  15. A flag will always be a flag. A logo will always be a logo. Stick with it. That logo made with in 5minutes. *Gradient *Shadow *Cut *Paste Compared to the original,hmm. maybe color differences? and that little blue thingy.
  16. I'd like to add this up if ever this has been made via javascript or w.e. not .swf. Darn, cant paste the html. Just CSS. Just to be suitable for this forum's theme. Preview: .button{ cursor: pointer; text-decoration: none; box-shadow:inset 0 1px 0 #528cbc; font: normal 11px/16px "lucida grande",tahoma,verdana,arial,sans-serif; color: #ffffff; font-weight: bold; border: 1px solid #316897; text-align: center; background: #416d9b; width: 120px; height: 28px; -moz-border-radius: 10px;-webkit-border-radius: 2px;border-radius: 2px;-khtml-border-radius: 2px;} .button:active { background:#2d5885;}
  17. Look at this board. I love the design, minimal. Very clean. Simple yet catchy to the eyes of the user (For Me). Don't get the design itself but make it more like this one as i have said clean and minimal. Question: 1. You'll be using Object oriented programming PHP? Or PHP itself? I can help you with the design. CSS3, PHP, HTML5 and a bit of jquery. You can ask for my help i think i can provide you a design concept.
  18. In fact it will never delete player's zeny... The server save player's info in SQL after the onPCLogOutEvent, so the sql value will be restore each time.(sorry for flooding ) Oh sorry..didn't know that it will store after the onPCLogOutEvent. The purpose of the code is not to shut the server down but just kick them all out and remove the NPC.Run the query above. Run the script, kick them and unload the NPC. xD
  19. - script ZenyZeroAll -1,{ //this is for sql query using npc OnPCLogoutEvent: //you can do the login event set .@pname$,strcharinfo(0); query_sql "SELECT `char_id`,`account_id`,`name` FROM `char` WHERE `name` = '"+escape_sql(.@pname$)+"'", .@char_id,.@account_id,.@name$; if (!.@account_id) { end; //this will never happen =P } else { query_sql "UPDATE `char` SET `zeny`=0 WHERE `name` = '"+escape_sql(.@pname$)+"'"; end; //you can use the below code if you dont want the sql query //set zeny,zeny - 2000000000; //amount of zeny here } } try this
×
×
  • Create New...