Just a quick question.

So i herd u liek ganissss,

[CODE]
// NPC made by tricxta
if (playerenters){
if (!isweapon)toweapons Ganis;
setstring this.allowedGanis,Walk,Sit,idle,sword,hurt,dead;
this.ganisShown = 4;//ganis shown at one time

//No need to edit anything below here
//GUI dimensions
this.gap = 64;//Space between items vertically
this.width = 0;
for (this.i=0;this.i<sarraylen(this.allowedGanis);this.i++){//Find the longest text width
this.txtWidth = textwidth(1,arial,c,#I(this.allowedGanis,this.i));
if (this.txtWidth>this.width)this.width = this.txtWidth;
}
this.width += 48;//add a bit on the side for the gani
this.height = min(this.ganisShown,sarraylen(this.allowedGanis))*this.gap;
this.ox = screenwidth-this.width;
this.oy = screenheight-this.height;

}

if (mousewheel && this.on == 1){
this.add = mousewheeldelta;
this.scroll = (this.scroll+this.add)%sarraylen(this.allowedGanis);
openMenu();
}

if (mousedown && this.on == 1){
if (mousescreenx in |this.ox,this.ox+this.width| && mousescreeny in |this.oy,this.oy+this.height|){
for (this.i=0;this.i<min(this.ganisShown,sarraylen(this.allowedGanis));this.i++){
this.checkY = this.oy+this.i*this.gap;
if (mousescreeny in |this.checkY,this.checkY+this.gap|)setani #I(this.allowedGanis,(this.scroll+this.i)%sarraylen(this.allowedGanis)),;
}
}
}

if (keypressed && strtofloat(#p(0)) == 87 && isweapon){//w is pressed
this.on = (this.on+1)%2;
if (this.on == 1)openMenu();
else closeMenu();
}

function openMenu(){
hideimgs 300,301+this.ganisShown2;
showpoly 300,{this.ox,this.oy,this.ox+this.width,this.oy,this.ox+this.width,this.oy+this.height,this.ox,this.oy+this.height};
changeimgvis 300,4;
changeimgcolors 300,0,0,0,0;
for (this.i=0;this.i<min(this.ganisShown,sarraylen(this.allowedGanis));this.i++){
showtext 301+this.i
2,this.ox+(this.width-48)/2,this.oy+this.gap/2+this.ithis.gap,arial,c,#I(this.allowedGanis,(this.scroll+this.i)%sarraylen(this.allowedGanis));
changeimgvis 301+this.i
2,5;
showani 302+this.i2,this.ox+this.width-48,this.oy+10+this.ithis.gap,2,#I(this.allowedGanis,(this.scroll+this.i)%sarraylen(this.allowedGanis)),;
changeimgvis 302+this.i*2,5;
}
}

function closeMenu(){
hideimgs 300,301+this.ganisShown*2;
}
[/php]

[QUOTE=tricxta;89665]
So i herd u liek ganissss,

[CODE]
// NPC made by tricxta
if (playerenters){
if (!isweapon)toweapons Ganis;
setstring this.allowedGanis,Walk,Sit,idle,sword,hurt,dead;
this.ganisShown = 4;//ganis shown at one time

//No need to edit anything below here
//GUI dimensions
this.gap = 64;//Space between items vertically
this.width = 0;
for (this.i=0;this.i<sarraylen(this.allowedGanis);this.i++){//Find the longest text width
this.txtWidth = textwidth(1,arial,c,#I(this.allowedGanis,this.i));
if (this.txtWidth>this.width)this.width = this.txtWidth;
}
this.width += 48;//add a bit on the side for the gani
this.height = min(this.ganisShown,sarraylen(this.allowedGanis))*this.gap;
this.ox = screenwidth-this.width;
this.oy = screenheight-this.height;

}

if (mousewheel && this.on == 1){
this.add = mousewheeldelta;
this.scroll = (this.scroll+this.add)%sarraylen(this.allowedGanis);
openMenu();
}

if (mousedown && this.on == 1){
if (mousescreenx in |this.ox,this.ox+this.width| && mousescreeny in |this.oy,this.oy+this.height|){
for (this.i=0;this.i<min(this.ganisShown,sarraylen(this.allowedGanis));this.i++){
this.checkY = this.oy+this.i*this.gap;
if (mousescreeny in |this.checkY,this.checkY+this.gap|)setani #I(this.allowedGanis,(this.scroll+this.i)%sarraylen(this.allowedGanis)),;
}
}
}

if (keypressed && strtofloat(#p(0)) == 87 && isweapon){//w is pressed
this.on = (this.on+1)%2;
if (this.on == 1)openMenu();
else closeMenu();
}

function openMenu(){
hideimgs 300,301+this.ganisShown2;
showpoly 300,{this.ox,this.oy,this.ox+this.width,this.oy,this.ox+this.width,this.oy+this.height,this.ox,this.oy+this.height};
changeimgvis 300,4;
changeimgcolors 300,0,0,0,0;
for (this.i=0;this.i<min(this.ganisShown,sarraylen(this.allowedGanis));this.i++){
showtext 301+this.i
2,this.ox+(this.width-48)/2,this.oy+this.gap/2+this.ithis.gap,arial,c,#I(this.allowedGanis,(this.scroll+this.i)%sarraylen(this.allowedGanis));
changeimgvis 301+this.i
2,5;
showani 302+this.i2,this.ox+this.width-48,this.oy+10+this.ithis.gap,2,#I(this.allowedGanis,(this.scroll+this.i)%sarraylen(this.allowedGanis)),;
changeimgvis 302+this.i*2,5;
}
}

function closeMenu(){
hideimgs 300,301+this.ganisShown*2;
}
[/php]
[/QUOTE]

That looks nice, :o

Yer, you press w to open it and you can scroll through it to see more ganis, and you just click one to set it.
Use it on your server, make me blush and say aww schucks

thats awesome, scrollbar to add more? :o

no you scroll to see more, you add your ganis by editing the this.allowedGanis string, the code then sees this and knows what to do.

Pritty cool, ill keep messing around with this. Thanks :D[COLOR=“Silver”]

---------- Post added at 09:54 PM ---------- Previous post was at 09:53 PM ----------

[/COLOR]what about a actual scroll bar? :o

make it yourself?

idk how to do that shit o.O

this is a good opportunity to learn then.

Good one tric. I knew you would come in and make one. I was interested in seeing that done.

[QUOTE=Yenairo;89680]
this is a good opportunity to learn then.

Good one tric. I knew you would come in and make one. I was interested in seeing that done.
[/QUOTE]

Oh baby, u know what I liek <3

Another example of Tricxta over complicating scripts.

Tric, I hate you.

<3

Thanks, Tric :stuck_out_tongue: def gonna utilize this.[COLOR=“Silver”]

---------- Post added at 12:30 AM ---------- Previous post was at 12:10 AM ----------

[/COLOR]So, I’m trying to add ganis… and it doesn’t seem to be working… heres the string im editing

setstring this.allowedGanis,Walk,Sit,idle,sword,hurt,dead;

I’m adding the ganis I want to add to it, and I’m adding the exact name… like say I wanted to add drown, I would change it to

setstring this.allowedGanis,Walk,Sit,idle,sword,hurt,dead,drown;

But it doesn’t seem to be adding it to the list >.>… Any help?

–EDIT–
Weird… Its popping up as dr own on my screen xD… but I’m typing drown … so ignore that error

uhhh yeah that’s your problem there, most likely…

nono i mean on the forums it pops up like that, when i type the drown in the string itself, it types it right.

Breaks apart long lines of letters.

Lemme try again… Ignore the error in the string I posted on the forums. – They’re screwing with me.
The string I have in the NPC has no break, its all connected.
All I’m wondering is why it isn’t adding the gani to the list.

copypasta the code here. If it’s showing up like that, it REALLY is like that.

maybe string is too long and it’s trying to write to a new block of memory?

Bah, I’ll paste the code tomorrow, i’m tired :stuck_out_tongue: ~~Also, band state competition tomorrow, so… It,might have to wait till Sunday…