Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

Have you purchased a mod and lost your copy? Just file a support ticket through your "My Mods" page.


This forum is now closed and has moved to a new location! Click here to find out why.

AuthorTopic: Can someone tell me where to stick this code. (I know what youre thinking)  (Read 214 times)

winfidel

  • Basic Member
  • *
  • Reputation Power: 8
  • winfidel has no influence.
  • Offline Offline
  • Posts: 16
    • View Profile
I have to place this Missions Code in Header
Code: [Select]
if($ir['mission'] != 0)
{
$mq=$db>query("SELECT * FROM missions WHERE id=".$ir['mission']."",$c);
if(mysql_num_rows($mq)== 0)
{
$db>query("UPDATE users SET mission=0 WHERE userid=".$userid."",$c);
}
$rm=mysql_fetch_row($mq);
if($rm['location_on']== 1)
{
if($rm['location_value'] != $ir['location'])
{ $db>_query("UPDATE users SET mission=0 WHERE userid=".$userid."",$c);
event_add($ir['userid'],"Your mission has been ended because you have moved city.",$c);
 }
}
if($rm['item_on']== 1 && $rm['attack_on']== 0)
{
$invq=$db>query("SELECT * FROM inventory WHERE inv_userid=".$userid." AND inv_itemid=".$rm['item_value']."",$c);
if(mysql_num_rows($invq))
{
$exp=rand($ir['level'],$ir['level']*5);
$db>query("UPDATE users SET mission=0, money=money+".$rm['money'].", crystals=crystals+".$rm['crystals'].", exp=exp+".$exp.", mission_counter=mission_counter+'1' WHERE userid=".$userid."",$c);
$mission=($ir['mission']);
$db>query("INSERT INTO missdone VALUES ($userid,$mission);",$c);
$db>query("DELETE FROM inventory WHERE inv_userid=$userid AND inv_itemid=".$rm['item_value']."",$c);
event_add($ir['userid'],"You have completed the mission and you was credited your reward.",$c);
 }
}
if($rm['item_on']== 0 && $rm['attack_on']== 0)
{
$db>query("UPDATE users SET mission=0 WHERE userid=".$userid."",$c);
$owner=1;
event_add($owner,"The mission $rm[name] mission ($rm[id]) is not set to a mission, Please do so.",$c);
}
if($rm['item_on']== 0 && $rm['attack_on']== 1)
{
$usa=$_SESSION['mission_attack'];
$aa=$db>query("SELECT * FROM missions WHERE id=".$ir['mission']." AND attack_value=".$_SESSION['mission_attack']."",$c);
if(mysql_num_rows($aa))
{
$exp=rand($ir['level'],$ir['level']*10);
$db>query("UPDATE users SET mission=0, money=money+".$rm['money'].", crystals=crystals+".$rm['crystals'].", exp=exp+".$exp.", mission_counter=mission_counter+'1' WHERE userid=".$userid."",$c);
$mission=($ir['mission']);
$db>query("INSERT INTO missdone VALUES ($userid,$mission);",$c);
event_add($ir['userid'],"You have completed the mission and you was credited your reward.",$c);
}
}
the instructions say Find: UPDATE users SET laston=unix_timestamp(), add after... I do and end up with unexpected end, parse this parse that... I messed with adding and taking away }'s and still I cant guess or fake my way through this. Dammit I even have this in the wrong category. My apologies.
« Last Edit: February 02, 2011, 09:47:17 AM by winfidel »
Logged

BlackVengeance

  • Basic Member
  • *
  • Reputation Power: 18
  • BlackVengeance has no influence.
  • Offline Offline
  • Posts: 22
    • View Profile
Re: Can someone tell me where to stick this code. (I know what youre thinking)
« Reply #1 on: February 03, 2011, 10:46:47 AM »
PM me your header ill put it where it needs to be for you.

Logged
 


This forum is now closed and has moved to a new location! Click here to find out why.