Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-25-2007, 03:02 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Guild Script

why wont this script work?

PHP Code:
//#CLIENTSIDE
function onPlayerchats() {
   if (
startswith "/guild")
     
setcharprop #g, #c;

__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #2  
Old 08-25-2007, 03:28 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Well, first off, you cant set a players guild clientside.
Second, I dont like it when people mix gs1 and gs2. -.-
Do something simple like this:
PHP Code:
function onActionGuild(){
player.guild params[0];
}
//#CLIENTSIDE
function onPlayerChats(){
  if (
player.chat.starts("/guild")){
    
triggeraction(0,0,"guild",this.name,player.chat.substring(7,-1));
  }

That should do it...
Reply With Quote
  #3  
Old 08-25-2007, 03:56 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
PHP Code:
function onActionServerside(acctgname) {
  
temp.pl findplayer(acct);
  
temp.pl.guild gname;
}
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("/guild")) {
    
temp.tokens player.chat.tokenize();
    
temp.blah temp.tokens[0].length() + 1
    triggerserver
("weapon"this.nameplayer.accountplayer.chat.substring(temp.blah));
  }

Should work.
__________________
Stan.
Reply With Quote
  #4  
Old 08-25-2007, 04:46 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Kyranki View Post
PHP Code:
function onActionServerside(acctgname) {
  
temp.pl findplayer(acct);
  
temp.pl.guild gname;
}
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("/guild")) {
    
temp.tokens player.chat.tokenize();
    
temp.blah temp.tokens[0].length() + 1
    triggerserver
("weapon"this.nameplayer.accountplayer.chat.substring(temp.blah));
  }

Should work.
Yet horribly insecure!
__________________
Do it with a DON!
Reply With Quote
  #5  
Old 08-25-2007, 04:47 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Quote:
Originally Posted by zokemon View Post
Yet horribly insecure!
At least he didnt say that about mine. "
Reply With Quote
  #6  
Old 08-25-2007, 05:26 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Kyranki View Post
Should work.
Wrong. Missed a semi-colon.

PHP Code:
function onActionServerside(acctgname) {
  
temp.pl findplayer(acct);
  
temp.pl.guild gname;
}
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("/guild")) {
    
temp.tokens player.chat.tokenize();
    
temp.blah temp.tokens[0].length() + 1;
    
triggerserver("weapon"this.nameplayer.accountplayer.chat.substring(temp.blah));
  }

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #7  
Old 08-25-2007, 06:33 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Why not just do:
findplayer(acct).guild = gname;

Also, shouldn't you send a parameter such as "changeguild" and check the onactionserverside for it for security measures?
Reply With Quote
  #8  
Old 08-25-2007, 07:13 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Quote:
Originally Posted by zokemon View Post
Yet horribly insecure!
Come now Zero, he wasn't looking for an extremely complex way of doing several commands. He just wanted a simple way to change the player's guild via chat. o.o

Quote:
Originally Posted by xXziroXx View Post
Wrong. Missed a semi-colon.

PHP Code:
function onActionServerside(acctgname) {
  
temp.pl findplayer(acct);
  
temp.pl.guild gname;
}
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("/guild")) {
    
temp.tokens player.chat.tokenize();
    
temp.blah temp.tokens[0].length() + 1;
    
triggerserver("weapon"this.nameplayer.accountplayer.chat.substring(temp.blah));
  }

Trifles.
__________________
Stan.
Reply With Quote
  #9  
Old 08-25-2007, 09:20 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
PHP Code:
function onActionServerside() {
  if (
params[0] == "guildself") {
    
player.guild params[1];
  }
}
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("/guild ")) {
    
triggerserver("weapon"this.name"guildself"player.chat.substring(7, -1));
  }

Better.
PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("/guild ")) {
    
System.serverFunction2(null"setVar""player.guild"player.chat.substring(7, -1));
  }

And then my way.
__________________
Reply With Quote
  #10  
Old 08-25-2007, 09:35 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Kyranki View Post
Come now Zero, he wasn't looking for an extremely complex way of doing several commands. He just wanted a simple way to change the player's guild via chat. o.o
Oh, I know. I was just making sure he knows that this isn't a script you should really have on a public server since it can easily be abused, hacked, etc.
__________________
Do it with a DON!
Reply With Quote
  #11  
Old 08-31-2007, 08:17 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
well, i was thinking of inputing it so only i can use it
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:19 PM.


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