|
Wishing he had 3 feet
|
Join Date: Aug 2001
Location: Basement
Posts: 1,565
|
|
While were showing off mouse scripts...I got bored and made this...its cool. :) Won't work w/o npc server (well some of it will..)
NPC Code:
if (actionserverside) {
if (strequals(#p(0),getPlayer)) {
with (getplayer(#p(1))) {
setstring thiso.player,#a;
thiso.hearts = playerhearts;
thiso.fhearts = playerfullhearts;
thiso.ap = playerap;
thiso.mp = playermp;
}
setstring clientr.playermenu,"#s(this.player)'s Status","Hearts #v(thiso.hearts)/#v(thiso.fhearts)","AP: #v(thiso.ap)","MP: #v(thiso.mp)";
}
}
//#CLIENTSIDE
if (playerenters || timeout) {
if (strlen(#s(client.colors))<=0) setstring client.colors,.2 .5 .9 1;
tokenize #s(client.colors);
this.r = strtofloat(#t(1));
this.g = strtofloat(#t(2));
this.b = strtofloat(#t(3));
this.a = strtofloat(#t(4));
getPlayer();
if (this.on == 1)
setstring this.menuitems,Status,"Hearts #v(playerhearts)/#v(playerfullhearts)","AP: #v(playerap)","MP: #v(playermp)";
if (this.wait>5) {
if (this.on == 1) updateDropdown();
if (mousebuttons == 1 && this.lock == 0) showDropdown();
if (mousebuttons == 4) hideDropdown();
if (mousewheeldelta!=0 && this.on == 1) {this.y+=(mousewheeldelta*25);moveDropdown();}
if (keydown2(keycode(u),true)) {this.wait=0;this.lock = 0;}
if (keydown2(keycode(n),true)) {this.wait=0;this.lock = 1;}
}
}
if (strlen(#s(clientr.playermenu))>0) {
for (i=0; i<sarraylen(clientr.playermenu); i++;) {
showimg 700+i,@#I(clientr.playermenu,i),5,120+(i*15);
changeimgvis 700+i,5;
changeimgzoom 700+i,.75;
changeimgcolors 700+i,this.r,this.g,this.b,this.a;
}
if (keydown2(keycode(h),true)) hidePlayer();
}
this.wait+=2.5;
timeout=.05;
}
function updateDropdown() {
for (i=0; i<sarraylen(this.menuitems); i++;) {
showimg 600+i,@#I(this.menuitems,i),this.x,this.y+(i*15);
changeimgvis 600+i,5;
changeimgzoom 600+i,.75;
changeimgcolors 600+i,this.r,this.g,this.b,this.a;
}
}
function showDropdown() {
this.on = 1;
this.wait=0;
for (i=0; i<sarraylen(this.menuitems); i++;) {
showimg 600+i,@#I(this.menuitems,i),mousescreenx,mousescre eny+(i*15);
changeimgvis 600+i,5;
changeimgzoom 600+i,.75;
changeimgcolors 700+i,this.r,this.g,this.b,this.a;
}
this.x = mousescreenx;
this.y = mousescreeny;
}
function moveDropdown() {
this.wait=0;
for (i=0; i<sarraylen(this.menuitems); i++;) {
showimg 600+i,@#I(this.menuitems,i),this.x,this.y+(i*15);
changeimgvis 600+i,5;
changeimgzoom 600+i,.75;
changeimgcolors 700+i,this.r,this.g,this.b,this.a;
}
}
function hideDropdown() {
this.on = 0;
this.wait=0;
for (i=0; i<sarraylen(this.menuitems); i++;) hideimg 600+i;
}
function getPlayer() {
for (i=0; i<playerscount; i++;) {
if (mousex in |players[i].x, players[i].x+3| && mousey in |players[i].y, players[i].y+4|) setstring this.account,#a(i);
}
triggeraction 0,0,serverside,-playerinfo,getPlayer,#s(this.account);
}
function hidePlayer() {
setstring this.account,;
for (i=0; i<sarraylen(clientr.playermenu); i++) hideimg 700+i;
setstring clientr.playermenu,;
}
if (playerchats) {
if (startswith(/colors,#c)) {
tokenize #c;
setstring client.colors,#t(1) #t(2) #t(3) #t(4);
}
if (strequals(#c,/status-help))
say2 #b
Status System.#b
Commands:#b
Left click - Show your own stats#b
Right click - Hide your stats#b
Mouse Wheel - move your stats#b
Press n - Lock your stats#b
Press u - Unlock your stats#b
Mouseover a player - View his/her#b
stats#b
Press h - Hide their stats#b
More soon!;
}
|
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
|
Last edited by Saga2001; 05-02-2002 at 03:50 PM..
|