Jump to content
  • 0

Help about this function


Munchkin

Question


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

I'm planning to make an item that gives immunity for a player that lasts a minute and can only be used on a specific map (i use ein_dun02)

getmapxy(@mapname$,@mapx,@mapy,0)
if(@mapname$ == "ein_dun02") {
attachnpctimer getcharid(3);
atcommand "@battleignore";
dispbottom "Item effect will last 1 minute or upon logging out.";
initnpctimer;
}
OnTimer60000:
OnTimerQuit:
atcommand "@battleignore";
end;

But i think something is wrong in which item effect will stack... x_x Someone can edit my code to make free of exploit?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

  • 'initnpctimer' can only run one object. You're looking for 'addtimer'.
  • Instead of 'getmapxy', you can use strcharinfo(3) to retrieve map info.
  • You didn't write any 'end' after the condition and are missing a semicolon, plus OnTimerQuit is never called. o.o

/* Item script */
if (strcharinfo(3) != "ein_dun02") end;
if (@battleignore) {
dispbottom "You can only run one instance of this item.";
end;
} else
set @battleignore,1;
addtimer 60000,"battleignore::OnStop";
atcommand "@battleignore";
dispbottom "Item effect will last 1 minute or upon logging out.";
end;

-	script	battleignore	-1,{
OnStop:
atcommand "@battleignore";
set @battleignore,0;
end;
}

  • Upvote 1
Link to comment
Share on other sites


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

Thank you sir Euphy ! you're the best :) I also have a question about your hunting script but i'll just pm it!

Link to comment
Share on other sites


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

What about to use sc_invincible instead? I find it more practical..

sc_start	sc_invincible	60000;

Edit: I hope that bonus wasn't been nerfed or deleted.

Edited by Ryokem
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...