yuhsing

Untitled

Dec 7th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1.  
  2. - script Sample#kill -1,{
  3. OnInit:
  4. bindatcmd("test",strnpcinfo(0)+"::OnAtCommand");
  5. .ItemID = 512;
  6. .Amount = 1;
  7. .Range = 15;
  8. end;
  9.  
  10. OnAtCommand:
  11. if( countitem( .ItemID ) < .Amount ){
  12. dispbottom "You need "+.Amount+" x "+getitemname( .ItemID );
  13. }else if( getstrlen( .@atcmd_parameters$[0] ) < 4 ){
  14. dispbottom "Please enter a player name.";
  15. }else if( isloggedin( getcharid( 3,.@atcmd_parameters$[0] ) ) && strcharinfo(0) != .@atcmd_parameters$[0] ){
  16. getmapxy( .@Map1$,.@X1,.@Y1,0,.@atcmd_parameters$[0] );
  17. getmapxy( .@Map2$,.@X2,.@Y2,0,strcharinfo(0) );
  18. if( distance( .@X1,.@Y1,.@X2,.@Y2 ) < .Range ){
  19. unitkill getcharid( 3,.@atcmd_parameters$[0] );
  20. unittalk getcharid(3),"I killed "+.@atcmd_parameters$[0];
  21. delitem .ItemID,.Amount;
  22. }else{
  23. dispbottom "Please get closer to him...";
  24. }
  25. }else{
  26. dispbottom "Must be an Online Player but not yourself.";
  27. }
  28. end;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment