Thread: MouseC Help
View Single Post
  #9  
Old 04-02-2011, 01:24 AM
cyan3 cyan3 is offline
Registered User
cyan3's Avatar
Join Date: Nov 2005
Location: England
Posts: 2,919
cyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant future
Quote:
Originally Posted by Fulg0reSama View Post
If I'm not mistaken, isn't this Tigairius's mousedrag?
(I'm probably mistaken but doesn't hurt to ask.)
I can confirm that it is Tigs.

Quote:
Originally Posted by Tigairius View Post
PHP Code:
// NPC made by Tig
function onStartDrag(control) {
  
triggerclient("gui", name, "startDrag", control.account);
}
//#CLIENTSIDE
function onCreated() {
}

function 
onActionClientside(command, acct) {
  switch (
command) {
    case 
"startDrag":
      
onTimeout();
    break;
  }
}

function 
onTimeout() {
  
temp.speed = 0.5;
  
temp.c = findplayer(client.controller);
  if (
temp.c.attr[20] == player.account) {
    
temp.pos = (temp.c.attr[28].substring(1, temp.c.attr[28].length() -2)).tokenize();
  }else {
    
client.controller = "";
    
setTimer(0);
    return;
  }

  if (
temp.pos != NULL) {
    if (
player.x + player.y != temp.pos[0] + temp.pos[1]) {
      
temp.dist = {temp.pos[0] - player.x, temp.pos[1] - player.y};
      
temp.mx = dist[0] / (speed * 16);
      
temp.my = dist[1] / (speed * 16);
      
player.x += mx;
      
player.y += my;
    }
  }
  
setTimer(0.05);
} 
Reply With Quote