Advertisement
Emistry

[RO] Fast Type Event - GM

Sep 28th, 2018
500
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. // https://rathena.org/board/topic/117023-is-a-passible-to-create-a-fast-type-event/
  2.  
  3. - script fast_type_main -1,{
  4. OnInit:
  5. bindatcmd("create", strnpcinfo(3)+"::OnCreate", 99, 99);
  6. bindatcmd("end", strnpcinfo(3)+"::OnEnd", 99, 99);
  7. bindatcmd("type", strnpcinfo(3)+"::OnAtcommand",0, 99);
  8. end;
  9.  
  10. OnCreate:
  11. if (.@atcmd_numparameters) {
  12. .status = 1;
  13. .event_type_size = .@atcmd_numparameters;
  14. deletearray .event_type$;
  15. copyarray .event_type$, .@atcmd_parameters$, .event_type_size;
  16. initnpctimer;
  17. }
  18. end;
  19.  
  20. OnAtcommand:
  21. if (.status && .event_type_size) {
  22. if (implode(.event_type$, " ") == implode(.@atcmd_parameters$, " ")) {
  23. announce "<Type Event> "+strcharinfo(0)+" won the game.", bc_all;
  24. donpcevent strnpcinfo(3)+"::OnEnd";
  25. }
  26. }
  27. end;
  28.  
  29. OnEnd:
  30. if (.status)
  31. announce "<Type Event> Event ended.", bc_all;
  32. stopnpctimer;
  33. .status = 0;
  34. deletearray .event_type$;
  35. end;
  36.  
  37. OnTimer1000:
  38. announce "<Type Event> First player to type '"+implode(.event_type$, " ")+"' win the game.", bc_all;
  39. end;
  40.  
  41. OnTimer10000:
  42. setnpctimer 0;
  43. end;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement