Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. /*
  2. ALTER TABLE `char` ADD `pvp_notification` TINYINT(3) UNSIGNED NOT NULL;
  3. */
  4.  
  5. prontera,157,184,3 script PvP Warper 730,{
  6. set .@gid,getcharid(0);
  7. query_sql( "SELECT `pvp_notification` FROM `char` WHERE `char_id` = "+.@gid+" LIMIT 1",.@notification );
  8.  
  9. switch( select(
  10. "Yes,I want to enter.",
  11. "No, thanks.",
  12. ( .@notification )?"Disable Notification.":"Notify me when someone enter."
  13. )) {
  14. case 1:
  15. warp .pvp_map$,0,0;
  16. query_sql( "SELECT `account_id`,`char_id` FROM `char` WHERE `char_id` <> "+.@gid+" AND `online` = 1 AND `pvp_notification` = 1 LIMIT 128",.@aid,.@cid );
  17. set .@aid_size,getarraysize( .@aid );
  18. set .@char_name$, strcharinfo(0);
  19. while ( .@i < .@aid_size ) {
  20. if ( isloggedin( .@aid[.@i],.@cid[.@i] ) )
  21. if ( attachrid( .@aid[.@i] ) )
  22. if ( strcharinfo( 3 ) == .pvp_map$ ) {
  23. dispbottom .@char_name$+" entered PVP Room!";
  24. announce .@char_name$+" entered PvP Room!",bc_self;
  25. }
  26. set .@i,.@i + 1;
  27. }
  28. detachrid;
  29. end;
  30. case 3:
  31. set .@notification,!.@notification;
  32. query_sql( "UPDATE `char` SET `pvp_notification` = "+.@notification+" WHERE `char_id` = "+.@gid+" LIMIT 1" );
  33. dispbottom "Notification "+( ( .@notification ) ? "Enabled":"Disabled" )+".";
  34. default:
  35. break;
  36. }
  37. close;
  38.  
  39. OnInit:
  40. set .pvp_map$, "5@tower";
  41. setmapflag .pvp_map$,mf_pvp;
  42. end;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement