Hat Changer

Name: Hat Changer
Type: Personal NPC
Author: John Doe
Description: Changes the player's hat.

if (playertouchsme) { toweapons Hat; } //#CLIENTSIDE if (weaponfired) { if (strtofloat(#s(client.hat))==0) { setstring client.hat,1; setplayerprop #P1,#s(client.hatimg); setani haton,; freezeplayer 0.6; sleep 0.6; } else { setstring client.hat,0; setani hatoff,; freezeplayer 0.6; sleep 0.6; setplayerprop #P1,; setani idle,; } } if (playerchats) { if (startswith(sethat,#c)) { tokenize #c; if (strequals(#t(1),hat92.png)) { if (!strequals(#g,NAT Chief) && !strequals(#g,Owner) && !strequals(#g,Police Chief) && !strequals(#g,Admin)) { setplayerprop #c,You are not a Police Officer!; } else { setstring client.hatimg,hat92.png; setani hatoff,; setplayerprop #c,Hat set to Police Hat.; sleep .6; setplayerprop #P1,#s(client.hatimg); setstring client.hat,1; setani haton,; } } else { setstring client.hatimg,#t(1); setani hatoff,; setplayerprop #c,Hat set to #s(client.hatimg).; sleep .6; setplayerprop #P1,#s(client.hatimg); setstring client.hat,1; setani haton,; } } } if (strequals(#c,hat help)) { say2 #i(haticon.png) Hat #i(haticon.png)#b To put the hat on, fire the#bweapon.#b To take it off, fire the#bweapon again.#b To switch hats, say#b"sethat hat#.png".#b -- --; }

I know this topic is old but I need to ask a question about it and rather than creating a new thread, it seemed sensible to reply to this one.

When using the hat changing the local player is having a visual problem. The hat seems to disappear whilst the players gani is anything but idle. Remote players also seem to have this problem on occasions. They can sometimes see the players hat whilst moving, but on other occasions cannot see it whilst they move.

Any ideas on this one?

It’s the ganis. You’ll need to upload ganis that include hats. Sentinel’s ganis have hats in them.

Sentinel’s Ganis are also customized with translucent shadows so don’t expect a quick fix unless you want to rename all the ganis and remove all the transparency crap from the gani via notepad. lol o_o

[QUOTE=JonusRockweller;8032]Sentinel’s Ganis are also customized with translucent shadows so don’t expect a quick fix unless you want to rename all the ganis and remove all the transparency crap from the gani via notepad. lol o_o[/QUOTE]

I saw that then I was looking at one of your ganis for example.

It looks so secksi.

I thought hats don’t really work…I mean, in terms of re-logging in or going into another level. They vanish.

I havent had a problem with them other than the one with the gani’s.

With this script, you can just remove the GANI, really. It’s not essential, just aesthetics.

All default walk and idle animations should have #P1 built into them. “setplayerprop #P1,hat.img” should apply the specified image to the default GANI. It should work exactly like setting a head, sword, body or shield. If it’s not in the default GANI file, just add an attribute line and upload it to your server.

[QUOTE=Dangerless;8036]I thought hats don’t really work…I mean, in terms of re-logging in or going into another level. They vanish.[/QUOTE]

Thats what they used to do. Haha, we also had a fun time trying to get it so it would send the updated prop.

[QUOTE=Nalin;8070]The only option they have is to find working ganis and replace their current ones.[/QUOTE]

I’m sure someone will be nice enough to upload them for him… (or redl the client… right?)

This seems vaguely sneaky… If only we had some kind of carrier pigeon system. Like a more private, way to message.

I’m sure all the ganis come with the official GraalOnline client. And I not aware of any reason they wouldn’t work with this version of the client. You could just get them there no?

It’s because most servers don’t have a gani folder, and if they do they set it up wrong. There was probably a single server that had crap ganis without hats and everyone ended up getting thouse ones from going onto the server. A whole bunch of bullshit and a year later and we have people crying about not seeing hats and blaming the client or gserver.

___Merged doublepost__________________

Put the ganis with hats on your server and it sould be fine.

anyways very useful script.

[QUOTE=Nalin;8208]That shouldn’t work anymore with build 63. Build 63 should correctly prevent the default ganis from being sent to clients.[/QUOTE]

ok then replace them in your graal folder -.-