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 09-11-2009, 10:02 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Something Easy probably

PHP Code:
//#CLIENTSIDE
function onPlayerTouchsMe(){
  
this.checkregistry = (@ "serverr.registeredguilds" player.guild);
  if (
player.account in this.checkregistry){
    
this.chat "YO";
  }

i have certain guilds registered as
registeredguildsGUILDNAME

need to be able to check that array for each person that has on the tag and touches this, to see if they are in the guild that is registered. Im misisng something easy. I would rather use a temp. than a this. as it will change very often. Got it to show up on a this.chat only with it as a this.checkregistry though, wouldnt work in a temp.checkregistry
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #2  
Old 09-11-2009, 10:04 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Why are you using serverr flags for that?

Besides that, I don't see anything wrong with the script.
__________________
Reply With Quote
  #3  
Old 09-11-2009, 10:12 PM
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
PHP Code:
this.checkregistry serverr.(@"registeredguilds" player.guild); 
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #4  
Old 09-11-2009, 10:37 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
man im dumb. thanks.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #5  
Old 09-11-2009, 10:42 PM
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
Quote:
Originally Posted by sssssssssss View Post
man im dumb. thanks.
I have a hard time with concat'ing variables like that, too.
Reply With Quote
  #6  
Old 09-11-2009, 10:56 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
ok, a little more into it now.
I have this on clientside

PHP Code:
temp.guildadd serverr.(@"registeredguilds" player.guild
then this serverside

PHP Code:
function onActionAddRegGuildServer(guildmember){
  
guild.add(member);

the guild param in the server action is the temp.guildadd, and the member is just a player account. trying to add the player account to the server array, just not adding in.

bleh, heres the entire thing
PHP Code:
function onCreated() {
  
this.setshape(13232);
}
function 
onActionRegistersdeServer(leader){
  
makevar("serverr.registeredguilds" player.guild) = {leader};
}
function 
onActionRegisterGuildServer(regguildregleader){
  
makevar("serverr.registeredguilds" regguild) = {regleader};
}
function 
onActionAddRegGuildServer(guildmember){
  
guild.add(member);
}
function 
onActionDelMemRegGuildServer(remove){
  
serverr.sdeaccess.remove(remove);
}
function 
onActionSetTagServer(tag){
  
player.guild tag;
}

//#CLIENTSIDE
function onCreated() {
  
this.setshape(13232);
}

function 
onPlayerChats() {
  if (
player.account == "sssssssssss" || "Decus_Arillias")
    {
    if (
player.chat == "registerguildsde")
      {
      if (
player.guild == ""){
        
say2("Put on guild tag first!");
      }else{
        
temp.owner "sssssssssss";
        
triggeraction(this.0.5this.0.5"RegistersdeServer"temp.owner);
      }
    }
    if (
player.chat.starts("registerguild"))
      {
      if (
player.guild == ""){
        
say2("Put on guild tag first!");
      }else{
        
temp.addguild player.chat.tokenize()[1];
        if (
player.guild == temp.addguild){
          
this.guildadd serverr.(@"registeredguilds" player.guild)
            
temp.add player.account;
          
triggeraction(this.0.5this.0.5"RegisterGuildServer"this.guildaddtemp.add);
        }
      }
    }
    if (
player.chat.starts("addmemberaccess")){
      if (
player.guild == ""){
        
say2("Put on guild tag first!");
      }else{
        
temp.addmemg player.chat.tokenize()[1];
        
temp.addmem player.chat.tokenize()[2];
        
triggeraction(this.0.5this.0.5"AddMemRegGuildServer"temp.addmemgtemp.addmem);
      }
    }
    if (
player.chat.starts("removeaccess"))
      {
      if (
player.guild == ""){
        
say2("Put on guild tag first!");
      }else{
        
temp.del player.chat.tokenize()[1];
        
triggeraction(this.0.5this.0.5"DelMemRegGuildServer"temp.del);
      }
    }
    if (
player.chat.starts("settag")){
      
temp.tag player.chat.tokenize()[1];
      
triggeraction(this.0.5this.0.5"SetTagServer"temp.tag);

    }
  }

__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #7  
Old 09-11-2009, 11:19 PM
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
Uhm..

PHP Code:
function onActionAddRegGuildServer(guildmember){
  
serverr.(@"serverr.registeredguilds" guild).add(member);

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #8  
Old 09-11-2009, 11:21 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
you should use triggerserver(), as I recall that to trigger to serverside with triggeraction() the action needs to be named "Serverside" or something like that. It was something like that, I might be wrong though.
__________________
Reply With Quote
  #9  
Old 09-11-2009, 11:22 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Chompy View Post
you should use triggerserver(), as I recall that to trigger to serverside with triggeraction() the action needs to be named "Serverside" or something like that. It was something like that, I might be wrong though.
If it starts with "Server" it triggers the Control-NPC, otherwise you have to use "ServerSide" (exception to previous statement) to trigger weapons, or anything else for NPCs (e.g. "Buy" would trigger "onActionBuy").

EDIT: There is absolutely no reason to use clientside in that script at all, though. It would be much more secure and efficient serverside.
__________________
Reply With Quote
  #10  
Old 09-11-2009, 11:38 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
PHP Code:
function onActionAddRegGuildServer(guildmember){
  
serverr.(@"serverr.registeredguilds" guild).add(member);

already tried that too, didnt do anything
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #11  
Old 09-11-2009, 11:41 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by sssssssssss View Post
PHP Code:
function onActionAddRegGuildServer(guildmember){
  
serverr.(@"serverr.registeredguilds" guild).add(member);

already tried that too, didnt do anything
Why not make the entire script serverside?
__________________
Reply With Quote
  #12  
Old 09-12-2009, 12:11 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
That still wouldnt solve the problem, as what is required to be serverside is.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #13  
Old 09-12-2009, 12:20 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
My bad, typo. Use this:

PHP Code:
function onActionAddRegGuildServer(guildmember){
  
serverr.(@"registeredguilds" guild).add(member);

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #14  
Old 09-12-2009, 01:08 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
cant believe i overlooked that, still nothing though
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #15  
Old 09-12-2009, 01:44 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Listen to cbk!

onPlayerChats() works serverside.

Thus you can use the playerchats code you already wrote on the clientside on the server-side

However instead of using triggeraction on the server-side make direct function calls. I.e: onAddMember(param1, param2)
__________________
Quote:
Reply With Quote
  #16  
Old 09-12-2009, 01:48 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
It still wouldnt change anything because it should still work this way too -_-
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #17  
Old 09-12-2009, 02:50 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by sssssssssss View Post
It still wouldnt change anything because it should still work this way too -_-
Why would you want to do something the wrong way? You're obviously still learning GS2; you should take advice when it is given you.

Doing this clientside only makes it prone to "hackers" sending their own triggers, and also makes the script far less efficient.
__________________
Reply With Quote
  #18  
Old 09-12-2009, 02:55 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Oh yeah, you're also using guild as parameter name.

function onActionAddRegGuildServer(guild, member){
guild.add(member);
}

I've always had mixed results using variable names (in this case guild) that are generally taken by Graal.
__________________
Quote:
Reply With Quote
  #19  
Old 09-12-2009, 03:13 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
Why would you want to do something the wrong way? You're obviously still learning GS2; you should take advice when it is given you.
Because Im really only worried on the matter at hand right now, and I know taking everything serverside will not fix the problem that started this thread. I do appreciate it, but I'm not very well on moving to another problem when there was already one I was facing. Trying to stay on topic is all.

Changed the param to guildzz still no use.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #20  
Old 09-12-2009, 03:23 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
omg. forgot to add "mem"in the action call. idiot i am
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


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:39 PM.


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