Iank1968
-
Posts
65 -
Joined
-
Last visited
Never
Posts posted by Iank1968
-
-
did what you said and its only printing array
-
in the reg_add is the bonus for the extra 1 EO$ per 100 played
Iam trying your suggestion, will let you know how it works out
-
can you please help me get this right?
-
Thats what im trying to figure out
-
this code is supose to add everything together and display it on a feed but it doesnt add past the 25 bonus.
heres the code
function GetLoginStories ($user) { global $bonus_table; if (!is_numeric ($user)) return; $bonus = array (); $bonus["bonus"] = array (); $result = Query ("SELECT unix_timestamp(date) as date,reg_add,lj_bonus,ic_bonus,hu_bonus,rod_bonus,chr_bonus,val_bonus,bug_bonus,camp_bonus,ch_bonus,coin_bonus,bill_bonus,bd_bonus,bb_bonus,cookie_bonus,metal_bonus,gem_bonus FROM $bonus_table WHERE uid=$user"); $num = mysql_num_rows ($result); for ($i=0; $i<$num; $i++) { $bonus_amt = 25 + mysql_result ($result, $i, "reg_add") + mysql_result ($result, $i, "bb_bonus") * 4 + mysql_result ($result, $i, "cookie_bonus") * 4 + mysql_result ($result, $i, "camp_bonus") * 4 + mysql_result ($result, $i, "bug_bonus") * 4 + mysql_result ($result, $i, "lj_bonus") * 8 + mysql_result ($result, $i, "ic_bonus") * 8 + mysql_result ($result, $i, "hu_bonus") * 8 + mysql_result ($result, $i, "ch_bonus") * 12 + mysql_result ($result, $i, "bd_bonus") * 12 + mysql_result ($result, $i, "rod_bonus") * 12 + mysql_result ($result, $i, "coin_bonus") * 16 + mysql_result ($result, $i, "bill_bonus") * 16 + mysql_result ($result, $i, "chr_bonus") * 50 + mysql_result ($result, $i, "val_bonus") * 25 + mysql_result ($result, $i, "gem_bonus") * 20 + mysql_result ($result, $i, "metal_bonus") * 20; //$bonus_amt=5; $bonus["bonus"][$i] = array (mysql_result ($result, $i, "date"), "<fb:name uid=\"$user\" /> received $bonus_amt Extremebucks on logon!"); }
can anyone help me as to why its not adding past the $bonus_amt = 25 + mysql_result ($result, $i, "reg_add")
thanks
-
I wasnt sure where this belonged, so I thought I would ask here first.
Here is some code that adds log ins, but the amount of logins and the amount it displays are always different.
function GetLoginStories ($user) { global $bonus_table; if (!is_numeric ($user)) return; $bonus = array (); $bonus["bonus"] = array (); $result = Query ("SELECT unix_timestamp(date) as date,reg_add,lj_bonus,ic_bonus,hu_bonus,rod_bonus,chr_bonus,val_bonus,bug_bonus,camp_bonus,ch_bonus,coin_bonus,bill_bonus,bd_bonus,bb_bonus,cookie_bonus,metal_bonus,gem_bonus FROM $bonus_table WHERE uid=$user"); $num = mysql_num_rows ($result); for ($i=0; $i<$num; $i++) { $bonus_amt = 25 + mysql_result ($result, $i, "reg_add") + mysql_result ($result, $i, "bb_bonus") * 4 + mysql_result ($result, $i, "cookie_bonus") * 4 + mysql_result ($result, $i, "camp_bonus") * 4 + mysql_result ($result, $i, "bug_bonus") * 4 + mysql_result ($result, $i, "lj_bonus") * 8 + mysql_result ($result, $i, "ic_bonus") * 8 + mysql_result ($result, $i, "hu_bonus") * 8 + mysql_result ($result, $i, "ch_bonus") * 12 + mysql_result ($result, $i, "bd_bonus") * 12 + mysql_result ($result, $i, "rod_bonus") * 12 + mysql_result ($result, $i, "coin_bonus") * 16 + mysql_result ($result, $i, "bill_bonus") * 16 + mysql_result ($result, $i, "chr_bonus") * 50 + mysql_result ($result, $i, "val_bonus") * 25 + mysql_result ($result, $i, "gem_bonus") * 20 + mysql_result ($result, $i, "metal_bonus") * 20; //$bonus_amt=5; $bonus["bonus"][$i] = array (mysql_result ($result, $i, "date"), "<fb:name uid=\"$user\" /> received $bonus_amt Extremebucks on logon!"); }
hope you can help with this
thanks
-
wel the code Iam using is a game, and when several people play it at the sametime my server goes nuts and crashes. server goes from 2 to 13 and crashes. most of it isnt my code and the guy who wrote the code isnt around anymore. Its probably way to mush to ask someone to actually go threw it and recommend ways to streamline it and find where the loops is thats causing the crashes, if thats what it is. I was told that splitting the file puts less strain on the server, but I wanted to ask here about that claim.
-
I want to split my common.php into 2 smaller files and still be read by the common.php file. Someone told me how to awhile ago but I cant find the thread. I also understand that splitting the file into 2 smaller files eleviates some strain on the server, is that true?
-
no this script was written by someone else who I cannot get ahold of now. its the only problem im having with this script. I thought it would be an easy solution, boy was I wrong lol. Let me get the rest of the code and post that. Hopefully it will be an easy solution.
-
I am new to PHP so please forgive me. I assume the static updates updates the players profile every 5 seconds to receive login credits which they only get every 3 hours. I did bump it up to 200 and everything is running ok.
When several people where on and playing the app crashed, it hasnt done that since I bumped it to 200. What I want to know is can I get rid of it? is it a nessesary function?
again please forgive me if im not making a whole lot of sense lol
-
im using it to refresh for logins. if 200 people are updating every 5 seconds would that make the server go huh and quit? lol
-
here is the code
$credit_time = 3*60*60; // how often should we give logon credits (secs) $credit_amount = 2500; // the number of cents we give if they logon after that interval $static_update = 300; // updates every 5 seconds
the updates every 5 seconds, would that bog down the server and cause a major bottleneck? can I get rid of it?
Thanks
-
I created a login program, for a game, but instead of counting it every 3 hours, it counts it every adventure. here is the code
$bonus_amt = 25 + mysql_result ($result, $i, "reg_add") + mysql_result ($result, $i, "bb_bonus") * 4 + mysql_result ($result, $i, "cookie_bonus") * 4 + mysql_result ($result, $i, "camp_bonus") * 4 + mysql_result ($result, $i, "bug_bonus") * 4 + mysql_result ($result, $i, "lj_bonus") * 8 + mysql_result ($result, $i, "ic_bonus") * 8 + mysql_result ($result, $i, "hu_bonus") * 8 +
is there anyway to shorten it I might not have enough info here, but would like to know if this can be shortened.
Thanks
-
Thanks alot, I will try it
-
HI,
I was wondering if there is a php testing tool where I can drop code into it and it finds errors and suggestions to fix the errors. I have 1800 lines of code I wish to test.
Thanks
-
obviously im missing code here lol. I will post the code I have for the log in
-
could not closing the function cause it to count over and over again instead of every 3 hours?
-
I made a login program that allows players to get a specific log in every 3 hours, but it when a player goes on an adventure it calculates the login every single time. Can someone help me with this code please.
function NewRegularInterval ($user) { //print "congrats 3 hour interval"; ?> <fb success message="Thanks for playing, you have been given EO$ 25 for logging in." /> <? global $users_table; Query ("UPDATE $users_table SET regular_intervals = regular_intervals + 1, last_logon_credit = NOW() WHERE uid=$user"); return GetRegularIntervals ($user); } function NewBonusInterval ($user, $num) { //print "congrats 3 hour interval"; ?>
the log in is supose to be calculated every 3 hours not every adventure lol
Thanks in advance for your help
Sorry about not using the [ code ] before
-
I made a login program that allows players to get a specific log in every 3 hours, but it when a player goes on an adventure it calculates the login every single time. Can someone help me with this code please.
function NewRegularInterval ($user) {
//print "congrats 3 hour interval";
?>
<fb success message="Thanks for playing, you have been given EO$ 25 for logging in." />
<?
global $users_table;
Query ("UPDATE $users_table SET regular_intervals = regular_intervals + 1,
last_logon_credit = NOW()
WHERE uid=$user");
return GetRegularIntervals ($user);
}
function NewBonusInterval ($user, $num) {
//print "congrats 3 hour interval";
?>
the log in is supose to be calculated every 3 hours not every adventure lol
Thanks in advance for your help
-
Does anyone feel like rewriting about 20 global functions I used? lol
-
ahhh ok. thanks alot for your help on this one. does global function bog your system and app way down as is claimed?
-
I created quite a few global functions, so I just move the global function inside the function and just get rid of the global?
-
I understand the using local variables is faster then Global. Here are 2 of the global function I created. Would anyone be able to tell me how to make it into a local variable, if thats the best thing to do.
function Query ($q) {
global $conn;
$result = mysql_query ($q, $conn);
if (!$result) {
}
and the second is
function LogStealAttempt ($user_from, $user_to, $what, $amt) {
global $logsendneg_table;
Query ("INSERT INTO $logsendneg_table SET uid_from=$user_from, uid_to=$user_to, what='$what', amt=$amt");
thanks
-
having a $bonus math problem here
in PHP Coding Help
Posted
All I want it to do is take this line
add all that together for each player and display it on the main page