yuhsing

Untitled

Apr 18th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. // make sure you run this query.
  2. // ALTER TABLE `guild` ADD COLUMN `storage_password` VARCHAR(32) NULL DEFAULT '' AFTER `emblem_data` ;
  3.  
  4. - script Sample -1,{
  5. OnInit:
  6. bindatcmd "guildstoragepw",strnpcinfo(3)+"::OnPassword";
  7. bindatcmd "guildstorage",strnpcinfo(3)+"::OnStorage";
  8. end;
  9.  
  10. OnPassword:
  11. if( getcharid(3) == getguildmasterid( getcharid(2) ) ){
  12. dispbottom "Only Guild Leader can use this.";
  13. }else{
  14. .@pass$ = escape_sql( .@atcmd_parameters$[0] );
  15. query_sql( "UPDATE `guild` SET `storage_password`='"+.@pass$+"' WHERE `guild_id`='"+getcharid(2)+"' LIMIT 1" );
  16. dispbottom "Updated Guild Storage Password : "+.@pass$;
  17. }
  18. end;
  19.  
  20. OnStorage:
  21. query_sql( "SELECT `storage_password` FROM `guild` WHERE `guild_id`='"+getcharid(2)+"' LIMIT 1",.@storage_pass$ );
  22. if( .@atcmd_parameters$[0] == .@storage_pass$ ){
  23. guildopenstorage();
  24. }else{
  25. dispbottom "Wrong Password.";
  26. }
  27. end;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment