Thread: MouseC Help
View Single Post
  #1  
Old 03-31-2011, 02:33 AM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
MouseC Help

Hey guys i have been using a drag script on Emera and i have suceeded in making it enable player chat to say "Being Dragged..." when him/her is being dragged. But i would like some help on where to put
PHP Code:
player.chat = "Stopped Drag"; 
here is MouseC
PHP Code:
 //Scripted by Emera :D
function onStartDrag(control) {
triggerclient("gui", name, "startDrag", control.account);
}
//#CLIENTSIDE

function onCreated() {
}

function 
onActionClientside(command, acct) {
switch (
command) {
case 
"startDrag":
onTimeout();
player.chat = "Being Dragged...";
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 * 8);
temp.my = dist[1] / (speed * 8);
player.x += mx;
player.y += my;
}
}
setTimer(0.001);

} 
__________________
Reply With Quote