Jump to content
  • 0

OnPCLoadMapEvent


Leehalt

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   0
  • Joined:  04/26/12
  • Last Seen:  

- Does anyone know how to effectively use this script? Mine doesn't seem to want to work. Just simple things like map ejection when requirements are not met, etc etc.

- Heres my code snip.

- script Map Guard:mgr01 -1,{
OnPCLoadMapEvent:
getmapxy(@mapname$,@mapx,@mapy,0);
 if(@mapname$ == "xanhart01"){
  if(lostinforest!=2) warp "prontera",141,229;
  end;
 }
 if(@mapname$ == "xan_fild01"){
  if(forestfallen==1)end;
  dispbottom "You wake up in a mysterious forest";
  set forestfallen,1;
  end;
 }
end;
}
xanhart01 mapflag loadevent
xan_fild01 mapflag loadevent

- Do i have to attachrid? [dont know how to use that]

- Also tried replacing to : if(strcharinfo(3) == "xan_fild01"){

if(forestfallen==1)end;

dispbottom "You wake up in a mysterious forest";

set forestfallen,1;

end;

}

- still doesnt work.

Edited by Leehalt
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

what is not working in the script ???

if(lostinforest!=2) warp "prontera",141,229;

it will only warp the player back to prontera if the variable condition matched...

 if(forestfallen==1)end;
  dispbottom "You wake up in a mysterious forest";

a message will be display if your variable forestfallen not equal to 1


- Do i have to attachrid? [dont know how to use that]

read this Attachrid

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   0
  • Joined:  04/26/12
  • Last Seen:  

- if(lostinforest!=2) warp"prontera",141,229; <--- doesnt warp people out, and as I understand, this reads: if lostinforest variable is NOT equal to 2, warp to prontera.

- if(forestfallen==1)end; // meaning nothing will happen if this occured once already

dispbottom "You wake up in a mysterious fores"; // doesnt pop out even if variable is equal to 1

set forestfallen,1; // makes it so it doesnt always dispbottom when people load this map.

======================================== edit ====================================

- solved my own problem, thanks for trying to help.

Edited by Leehalt
Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

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