Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Guild Script (https://forums.graalonline.com/forums/showthread.php?t=76470)

Knightmare1 08-25-2007 03:02 AM

Guild Script
 
why wont this script work?

PHP Code:

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



oo_jazz_oo 08-25-2007 03:28 AM

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...

Kyranki 08-25-2007 03:56 AM

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.

zokemon 08-25-2007 04:46 AM

Quote:

Originally Posted by Kyranki (Post 1342791)
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!

oo_jazz_oo 08-25-2007 04:47 AM

Quote:

Originally Posted by zokemon (Post 1342794)
Yet horribly insecure!

At least he didnt say that about mine. ^^"

xXziroXx 08-25-2007 05:26 AM

Quote:

Originally Posted by Kyranki (Post 1342791)
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));
  }



DustyPorViva 08-25-2007 06:33 AM

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?

Kyranki 08-25-2007 07:13 AM

Quote:

Originally Posted by zokemon (Post 1342794)
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 (Post 1342799)
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. :(

Inverness 08-25-2007 09:20 AM

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.

zokemon 08-25-2007 09:35 AM

Quote:

Originally Posted by Kyranki (Post 1342809)
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.

Knightmare1 08-31-2007 08:17 AM

well, i was thinking of inputing it so only i can use it


All times are GMT +2. The time now is 10:29 AM.

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