Jump to content
MakeWebGames

Recommended Posts

Posted

rather than waste your time adding a whole new file for the starter pack just add this to the top of loggedin.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

and run this

[mysql]ALTER TABLE users ADD starter INT(11) DEFAULT 0;[/mysql]

Posted

Nifty.

However, you save save yourself the extra field in the user's table by just adding this to the register page, immediately after inserting data into the user's table. ;)

Posted
You should check into item_add() function. Will make your life alot easier.

I may have missed something, but I see no need for item_add here...

item_add just adds a new item to a user's inventory, quantifying it with other items that exist within a user's inventory.

However, a new user is guaranteed to have an empty inventory. So... no reason to quantify it.

Posted

Yeah new user has nothing, but only about 20% will actually claim a starter pack first. 80% will checdk the game out first to see if it is a waist of time. And in the adventure will get stuff.

Besides it is good habit to use your funciton regardless if you need it or not.

Posted
Yeah new user has nothing, but only about 20% will actually claim a starter pack first. 80% will checdk the game out first to see if it is a waist of time. And in the adventure will get stuff.

I don't mean to keep disagreeing with you, but... that is irrelevant. The mod he posted in the first post automatically grants the user the bonus when they first login. There is no 'claiming' involved, just login for the first time and 'poof' you get it.

 

Besides it is good habit to use your funciton regardless if you need it or not.

Meh, to each his own. I disagree completely - no need to use a function that is full of bloated junk you don't need, but you're way works just fine too here.

Posted

I would do this however james ;) shorten your darn queries :P

and if you are going to use $db you dont need to use $c.

so

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Guest Drizzle
Posted

or u can just add a $user query and fetch their userid(after inserted) in register, which will then allow it to send an event before they even login, acting like the same thing your talking about, with one less column in the users table to worry about :)

Guest Drizzle
Posted

if ur gonna be putting $c at the end of your queries u might as well just use mysql_query and save some variables from loading lol.

Guest Drizzle
Posted
rather than waste your time adding a whole new file for the starter pack just add this to the top of loggedin.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

mysql_query(sprintf("UPDATE `users`" . "SET `crystals`=%u,"."`money`=%u,"."`donatordays`=%u"." WHERE `userid`=%u",100,10000,5,$_POST['user'],$c));

mysql_query(sprintf("INSERT INTO "."`inventory` "."VALUES('',%u,'%u',%u)",1,$_POST['user'],100,$c));

mysql_query(sprintf("INSERT INTO "."`inventory` "."VALUES('',%u,'%u',%u)",2,$_POST['user'],100,$c));

event_add($_POST['user'],"Yo bro you juz got the hook-upz! Check yur inventory for your new stuff. Peace out, - Admin",$c);

I actually have that on my game lol. well the event part. the rest isnt tested, but should work.

Posted

why...

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

$db->query("UPDATE users SET crystals=crystals+100 WHERE userid=$userid",$c);

$db->query("UPDATE users SET money=money+10000 WHERE userid=$userid",$c);

$db->query("UPDATE users SET donatordays=donatordays+5 WHERE userid=$userid",$c);

$db->query("UPDATE users SET starter=1 WHERE userid=$userid");

can all be ONE query.

Guest Drizzle
Posted

Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.);

ive never tried but it seems logical

Posted
Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.);

ive never tried but it seems logical

And you call you're self a programmer?

Posted
2
I would do this however james ;) shorten your darn queries :P

and if you are going to use $db you dont need to use $c.

so

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Yet still a failure why would you run more queries when you don't need to? n00b.

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Changed into one:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Simple n000b.

Guest Drizzle
Posted
Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.);

ive never tried but it seems logical

And you call you're self a programmer?

Ive only been at it for like a year.

Posted
Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.);

ive never tried but it seems logical

And you call you're self a programmer?

Ive only been at it for like a year.

Well guys after all the talk that Drizzle was a noob that thought taking back up of sites that he was working on it seems that he decided to single me out in his bid to win over the community... (oh how honored i feel right now....)

After a message that was more snotty than anything else i sent him a piece of my mind waking him up to a number of truths that came out about him while he was trying to fight his corner...

I told him that reputation for doing things like this would ruin his chances of work and what do i get back from him in a following message? This:

"i really dont care if you tell ppl to read the post, because i really dont care. Is it hard to just make a new account, email, and make some free mods, and then get some clients? no it isnt. But id rather try to rebuild my name instead of doing that."

Well it goes to show that scammers, blackmailers and complete an utter tossers who feel that a browse over the php tutorials on youtube make them a coder could really be the same person...

All i said was that after all this, anyone i know within the industry will be avoiding his so called services... although have to say that a back up service that i haven't paid for sounds great.... oh wait... erm no, no its not.

The guy is a jumped up kid that needs to stop trying to belittle other members before someone takes his lunch money from him....

Posted
Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.);

ive never tried but it seems logical

And you call you're self a programmer?

Ive only been at it for like a year.

I've not been at programming that long, maybe a year - year and a half so.. :whistling:

Guest Drizzle
Posted
Hey, ive been wondering is it possible to merge two kinds of queries into one? LIke mysql_query(UPDATE table SET value=whatever WHERE user=blah, INSERT INTO table VALUES('blah'), etc.);

ive never tried but it seems logical

And you call you're self a programmer?

Ive only been at it for like a year.

Well guys after all the talk that Drizzle was a noob that thought taking back up of sites that he was working on it seems that he decided to single me out in his bid to win over the community... (oh how honored i feel right now....)

After a message that was more snotty than anything else i sent him a piece of my mind waking him up to a number of truths that came out about him while he was trying to fight his corner...

I told him that reputation for doing things like this would ruin his chances of work and what do i get back from him in a following message? This:

"i really dont care if you tell ppl to read the post, because i really dont care. Is it hard to just make a new account, email, and make some free mods, and then get some clients? no it isnt. But id rather try to rebuild my name instead of doing that."

Well it goes to show that scammers, blackmailers and complete an utter tossers who feel that a browse over the php tutorials on youtube make them a coder could really be the same person...

All i said was that after all this, anyone i know within the industry will be avoiding his so called services... although have to say that a back up service that i haven't paid for sounds great.... oh wait... erm no, no its not.

The guy is a jumped up kid that needs to stop trying to belittle other members before someone takes his lunch money from him....

ehh.. you sure do type alot.

Guest Drizzle
Posted

actually, ive never bothered to look at a tutorial on youtube. and im not going to.

Posted
ehh.. you sure do type alot.
Wow, check you out...

You comment on other peoples coding and its clear to see that your copy and paste coding effort on the thedrizzlenetwork.com is going to make you rich!

Mate, i have never had issues with your coding but you come to me after i tell you to stop been an arse and trying to blackmail someone who you stole a back up of his site and you come to me looking to explain yourself....?

Thing is you have admitted the fact that you took it and tried to sell it back and went on to point out your TOS which were so brief i could have wiped my arse with them and thats about it...

Truth of the matter is, alter your username and email all you want... your coding and your talk all smells the same....

Guest Drizzle
Posted

and i dont have a problem with you. i'd admit that it was wrong to take the backup, and then try to sell it back. But i dont copy and paste code. Maybe if its my code, i will, but i dont copy other ppls code. thats just plain wrong. And where do you get this "blackmail" part?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...