Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Sethat system by Neo (https://forums.graalonline.com/forums/showthread.php?t=81906)

Soala 09-19-2008 05:28 PM

Sethat system by Neo
 
Okay so Neo (Deas_Voice) was too busy to post it
Here we go, credits goes to him.
PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  
tokens player.chat.tokenize();
  
// use sethat image to set ur hat
  
if (tokens[0] == "sethat") {
    
player.attr[1] = tokens[1];
    
player.client.ishat tokens[1];
  }



Deas_Voice 09-19-2008 05:30 PM

.....................
WHY !! WHY!! :'(

i could posted this myself..

Tigairius 09-19-2008 05:31 PM

Quote:

Originally Posted by alexandralove (Post 1424612)
Okay so Neo (Deas_Voice) was too busy to post it
Here we go, credits goes to him.
PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  
tokens player.chat.tokenize();
  
// use sethat image to set ur hat
  
if (tokens[0] == "sethat") {
    
player.attr[1] = tokens[1];
    
player.client.ishat tokens[1];
  }



Could also do this:

PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("sethat")) {
    
player.attr[1] = client.ishat player.chat.tokenize()[1];
  }


but nice :)

Soala 09-19-2008 05:33 PM

Quote:

Originally Posted by Deas_Voice (Post 1424613)
.....................
WHY !! WHY!! :'(

i could posted this myself..

You were too lazy :o
Too late lol.

P.S: REP GOES FOR NEO

Deas_Voice 09-19-2008 05:34 PM

Quote:

Originally Posted by Tigairius (Post 1424615)
Could also do this:

PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("sethat")) {
    
player.attr[1] = client.ishat player.chat.tokenize()[1];
  }


but nice :)

ty x_x... soala u could just have waited 5 min so i could post it myself >(

Tigairius 09-19-2008 05:35 PM

Quote:

Originally Posted by Deas_Voice (Post 1424617)
ty x_x... soala u could just have waited 5 min so i could post it myself >(

Don't get mad over it, the script was pretty basic. At least it wasn't a big complex system :)

Deas_Voice 09-19-2008 05:41 PM

Quote:

Originally Posted by Tigairius (Post 1424618)
Don't get mad over it, the script was pretty basic. At least it wasn't a big complex system :)

well im kinda mad on him cus he was like "u should post this in the GG, it would be great for new server", and i said yeah sure, just a min...
then he goes and post it :\

DrakilorP2P 09-19-2008 07:00 PM

Quote:

Originally Posted by Deas_Voice (Post 1424621)
well im kinda mad on him cus he was like "u should post this in the GG, it would be great for new server", and i said yeah sure, just a min...
then he goes and post it :\

I fail to understand why anyone would care who the poster is.

Kristi 09-19-2008 07:37 PM

Quote:

Originally Posted by Tigairius (Post 1424615)
Could also do this:

Or this:

PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  
// space to weed out a ridiculous word (?sethatman)
  
if (player.chat.starts("sethat ")) {
    
// no searching compared to token
    
player.attr[1] = client.ishat player.chat.substring(7); 
  }



Soala 09-19-2008 07:38 PM

Quote:

Originally Posted by DrakilorP2P (Post 1424626)
I fail to understand why anyone would care who the poster is.

Especially when I give the credits O_O

Deas_Voice 09-19-2008 09:05 PM

Quote:

Originally Posted by DrakilorP2P (Post 1424626)
I fail to understand why anyone would care who the poster is.

he talkt me into it :whatever:

DrakilorP2P 09-19-2008 11:29 PM

Quote:

Originally Posted by Deas_Voice (Post 1424657)
he talkt me into it :whatever:

He posted the script and then talked you into getting upset over it?

maximus_asinus 09-20-2008 02:17 AM

so I could put pics1.png as my hat?

Deas_Voice 09-20-2008 03:18 PM

Quote:

Originally Posted by maximus_asinus (Post 1424710)
so I could put pics1.png as my hat?

no stupid -_-

Crow 09-20-2008 03:27 PM

Quote:

Originally Posted by Deas_Voice (Post 1424835)
no stupid -_-

Yes, he basically could. You could check if the name of the image includes "hat" though.

PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  if (!
player.chat.starts("sethat "))
    return;
  
  if (
player.chat.trim().substring(6).pos("hat") == -1)
    return;
  
  
player.attr[1] = client.ishat player.chat.trim().substring(6);



Deas_Voice 09-20-2008 03:29 PM

oh comon .. give me a break!
you can do it in alot of ways!
no need to state them all??????

Crow 09-20-2008 03:36 PM

Quote:

Originally Posted by Deas_Voice (Post 1424840)
oh comon .. give me a break!
you can do it in alot of ways!
no need to state them all??????

I just added something to check if "hat" is somewhere in the file name stated by the player. The other stuff is basically preference.

DrakilorP2P 09-20-2008 04:21 PM

mud_whatsit.png

Soala 09-20-2008 04:23 PM

Quote:

Originally Posted by drakilorp2p (Post 1424855)
mud_whatsit.png

orly?

DarkReaper0 09-20-2008 07:09 PM

Quote:

Originally Posted by maximus_asinus (Post 1424710)
so I could put pics1.png as my hat?


Yes you could, in fact I run around like that all the time on free-hat servers xD


All times are GMT +2. The time now is 07:37 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.