Jump to content
MakeWebGames

Recommended Posts

Posted

Ok so I'm a noob at coding, but I'm tryna get better, please correct my errors and tell me what they are. I'm trying to make it so people can't attack level 1's. I know this is basics for most of you, but you must have gone through this.

 

else if($odata['level'] ==1)
{
print "<center><font size=5>You cannot attack a level 1 as they won't be able to do much back to you.</font></center>";
$h->endpage();
exit;
}

 

I used the $oadata as Alabamahit said $ir is for you, and $oadata is for them.

Posted

Re: No attacking level 1

Oh wow I can code something... :mrgreen:

How would the <3 days thing work?

 

else if($odata['daysold'] <3)
{
print "<center><font size=5>You cannot attack someone who has been playing Game Name for less than 3 days as they won't be able to do much back to you.</font></center>";
$h->endpage();
exit;
}

 

Also just wondering, as i took a guess, the 'daysold 'level' and stuff, is that a column in the Mysql DB?

Posted

Re: No attacking level 1

I understand your learning. Instead of asking will this work...

Try it...that looks right to me.

But the best way to learn is put the code in see what it does. don't ask if it will work.

Posted

Re: No attacking level 1

 

I'm asking if the 'level' and 'fedjail' and stuff are columns in the mysqlDB?

yeah they are, somewhere there will a query that selects the record of the player your attacking and turns into an array.

Posted

Re: No attacking level 1

some people would stay level 1 on purpose tough, the 3 day idea is better.

Or a better idea; You can not be attacked for 7 days (safety) and if you attack someone before 7 days you loose safety..

Posted

Re: No attacking level 1

 

else if($odata['daysold'] < 7)
{
  echo('<center>[b]You cannot attack someone who has been playing Game Name for less than 7 days as they won't be able to do much back to you.[/b]</center>');
  $h->endpage();
  exit;
}

not really that difficult to take it from gurpreet's post...

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...