Setguild Command

this is for people who don’t know how to get a working setguild command (those who didnt read the gserver readme, etc)

if (playerenters) {toweapons -guildsystem } if (playerchats) { tokenize #c(0); if (strequals(#t(0),setguild)) triggeraction 0,0,gr.setguild,#t(1); }this is the script. to get it working on your server you need to set the triggerhack “triggerhack_guilds” at the bottom of the serveroptions.txt to true.

whats with the “tokenize #c(0);” ? I’ve never seen #c(0) used before . I always just did “tokenize #c;” to tokenize the whole chat and picked out the part i wanted depending on the place in the chat . like #t(0) for the first word , #t(1) for the second word and so on .

multiple chat commands I guess.

this is part of the script I use that has tokenize #c(0);

if (strequals(#t(1),apset)) setstring apstring,#v(strtofloat(#t(0))); if (strequals(#t(1),swordset)) setsword #1,strtofloat(#t(0)); if (strequals(#t(1),shieldset)) setshield #2,strtofloat(#t(0)); if (strequals(#t(1),rupeeset)) players[0].rupees=strtofloat(#t(0)); if (strequals(#t(1),mpset)) players[0].mp=strtofloat(#t(0));

no need to have the index on #c

if (playerenters) { toweapons -guildsystem } if (playerchats) { if (startswith(setguild,#c)) triggeraction 0,0,gr.setguild,#e(9,-1,#c); }

wtf is 9,-1 mean?

and I used tokenize system because im used to using it…

Beholder showed him how to use #e. It’s shorter but you kids will die before you use it regularly.

#e(start,length,string)

It’s a trimming command.
whatthehellyouasshat
#e(14,6,whatthehellyouasshat) -> asshat

I know what it is. I now how to use it, too.

Everything is made better with asshat

You could have used -1 to go to the end…

I just didn’t feel like typing it out “-1 to go to the end of the string”

Well now they know.