Jump to content
  • 0

loadevent problems


muzika

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  10/12/12
  • Last Seen:  

Hi, can anyone help me with my script problem. The thing is i have this script for battleground that blocks the player if he/she have more than 2 character in bat_room map and timetick checker for my dra_lake map. Both script use loadevent mapflag. I find it confusing when the player load on the map either bat_room or dra_lake the server uses the script restriction on both map. 

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  82
  • Reputation:   1
  • Joined:  04/30/13
  • Last Seen:  

Please post the script.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  10/12/12
  • Last Seen:  

- script Maroll Script -1,{
OnPCLoadMapEvent:
getmapxy .Maroll$,@x,@y,0;
if (query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1", .@account_id) > 5) {
warp "new_pront",156,177;
dispbottom "You exceeded the maximum accounts allowed in this area.";
end;
}
OnInit:
setarray .Maroll$,"bat_room";
setmapflag .Maroll$, mf_loadevent;
end;
}

-	script	Dungeon Script	-1,{

OnPCLoadMapEvent:
	getmapxy .Dungeons$,@x,@y,0;
	setarray .Dungeons$,"inzektor","necro","infernity","naturia","mermail","noble","dra_lake","dra_dun","dra_dun01","dra_dun02","dra_dun03";
	if(gettimetick(2) - #Dungeon < (60 * 60 * 1)) {
	warp "new_pront",156,177;
	dispbottom "You need to wait atleast 1 hour before your next run.";
	end;
	}
}

inzektor	mapflag	loadevent
necro	mapflag	loadevent
infernity	mapflag	loadevent
naturia	mapflag	loadevent
mermail	mapflag	loadevent
noble	mapflag	loadevent
dra_lake	mapflag	loadevent
dra_dun	mapflag	loadevent
dra_dun01	mapflag	loadevent
dra_dun02	mapflag	loadevent
dra_dun03	mapflag	loadevent
Edited by muzika
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

1. Why do you execute a getmapxy if you don't use the resulting variables?

2. What is the question/problem?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  82
  • Reputation:   1
  • Joined:  04/30/13
  • Last Seen:  

Try something like:

 



OnPCLoadMapEvent:
getmapxy .Maroll$,@x,@y,0;
if ( .@mapname$ == "bat_room" ) {
if (query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1", .@account_id) > 5) {
warp "new_pront",156,177;
dispbottom "You exceeded the maximum accounts allowed in this area.";
end;
}
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

Try something like:
 
OnPCLoadMapEvent:
getmapxy .Maroll$,@x,@y,0;
if ( .@mapname$ == "bat_room" ) {
if (query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1", .@account_id) > 5) {
warp "new_pront",156,177;
dispbottom "You exceeded the maximum accounts allowed in this area.";
end;
	}
}

Aaaah, so his question was: "How do I check which map was entered?". I see...

rqueen, your script wont work, because .@mapname$ doesn't have a value.

Try this:

OnPCLoadMapEvent:
  if (strcharinfo(3) == "bat_room" && query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1", .@account_id) > 5)
  {
    dispbottom "You exceeded the maximum accounts allowed in this area.";
    warp "new_pront",156,177;
  }
  end;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  82
  • Reputation:   1
  • Joined:  04/30/13
  • Last Seen:  

Oops, missed that. Thanks!

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