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-06-2007, 02:41 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
if (GangTagSystem != Working) { //what do I do? }

Name says it all. The script is here:

PHP Code:
function onActionServerSide() {
  
with(findplayer(params[0])) {
    if (
player.guild != clientr.gang) {
      
player.nick player.nick" *" @clientr.gangrank"* (" @clientr.gang")";
    }
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/gang tag") {
    if (
strlen(#s(clientr.gang > 0))) {
      
triggerserver("weapon"this.nameplayer.account);
    }
  }

How can I get it working? It just sits there and does nothing. And yes, I DO have it (wep) in my attributes.

Also, if anything is in GS1, if you can can you please convert it to GS2?
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #2  
Old 09-06-2007, 02:47 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
if (strlen(#s(clientr.gang > 0))) {
can be changed to
if (clientr.gang > 0){
t does the same thing :P
__________________
Trying to be nice now...
Reply With Quote
  #3  
Old 09-06-2007, 02:49 AM
PrinceOfKenshin PrinceOfKenshin is offline
That guy with a beard
PrinceOfKenshin's Avatar
Join Date: May 2004
Location: Ontario, Canada
Posts: 819
PrinceOfKenshin has a spectacular aura aboutPrinceOfKenshin has a spectacular aura about
Well try
PHP Code:
function onActionServerSide() {
  
with(findplayer(params[0])) {
    if (
player.guild != clientr.gang) {
      
player.nick player.nick " *" @clientr.gangrank"* (" @clientr.gang")";
    }
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/gang tag") {
    if (
strlen(clientr.gang 0)) {
      
triggerserver("gui""weapon"player.account);
    }
  }

__________________


Quote:
Game Master (Server): Greetings PrinceOfKenshin, there are new posts on the forums that demand your urgent attention! God speed, the fate of the world is in your hands. If you fail, middle earth will forever be in the darkness and your children will be enslaved by McKain.
Reply With Quote
  #4  
Old 09-06-2007, 02:53 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Nope didn't work, Mike
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #5  
Old 09-06-2007, 02:57 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
Quote:
Originally Posted by PrinceOfKenshin View Post
Well try
PHP Code:
function onActionServerSide() {
  
with(findplayer(params[0])) {
    if (
player.guild != clientr.gang) {
      
player.nick player.nick " *" @clientr.gangrank"* (" @clientr.gang")";
    }
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/gang tag") {
    if (
strlen(clientr.gang 0)) {
      
triggerserver("gui""weapon"player.account);
    }
  }

God, mixing GS1 and GS2 makes me cringe. That script is wrong btw.
PHP Code:
function onActionServerSide() {
  if (
player.guild != clientr.gang) {
    
player.nick player.nick " *" @clientr.gangrank"* (" @clientr.gang")";
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/gang tag") {
    if (
clientr.gang.length() > 0) {
      
triggerserver("gui"this.namenull);
    }
  }

I would normally add a parameter for what the serverside part is doing as a security measure, but didn't want to confuse it.

Also, triggers preserve the calling player so you don't need to use the findplayer() on serverside unless you want to access a player that isn't yourself.
__________________
Reply With Quote
  #6  
Old 09-06-2007, 03:43 AM
PrinceOfKenshin PrinceOfKenshin is offline
That guy with a beard
PrinceOfKenshin's Avatar
Join Date: May 2004
Location: Ontario, Canada
Posts: 819
PrinceOfKenshin has a spectacular aura aboutPrinceOfKenshin has a spectacular aura about
well strlen was in the commands.rtf for gs2 so i thought that was ok.
__________________


Quote:
Game Master (Server): Greetings PrinceOfKenshin, there are new posts on the forums that demand your urgent attention! God speed, the fate of the world is in your hands. If you fail, middle earth will forever be in the darkness and your children will be enslaved by McKain.
Reply With Quote
  #7  
Old 09-06-2007, 03:59 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
Why don't you just set the player's guild instead of doing all that with the nick? o_O
__________________
Stan.
Reply With Quote
  #8  
Old 09-06-2007, 06:07 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
Quote:
Originally Posted by Kyranki View Post
Why don't you just set the player's guild instead of doing all that with the nick? o_O
Guild Rank
__________________
Reply With Quote
  #9  
Old 09-06-2007, 06:08 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
Quote:
Originally Posted by PrinceOfKenshin View Post
well strlen was in the commands.rtf for gs2 so i thought that was ok.
There is no commands.rtf for GS2, that was made for GS1 and random people added onto it, you need to read the Wiki.
__________________
Reply With Quote
  #10  
Old 09-06-2007, 04:51 PM
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
Instead of:
NPC Code:
strlen(string)


Please use:
NPC Code:
string.length()



Like:
NPC Code:
clientr.gang.length() > 0


(Or you can just do clientr.gang != "")
__________________
Do it with a DON!
Reply With Quote
  #11  
Old 09-07-2007, 12:08 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Thanks, it works now

Also, why'd you make it a "gui" [triggerserver("[I]gui[I]",.);]? It's supposed to be a weapon
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #12  
Old 09-07-2007, 12:51 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
Because weaponNPCs are considered gui's.
Reply With Quote
  #13  
Old 09-07-2007, 01:38 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
Quote:
Originally Posted by DustyPorViva View Post
Because weaponNPCs are considered gui's.
For some strange reason.
__________________
Reply With Quote
  #14  
Old 09-07-2007, 02:24 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Oh really? When I changed "gui" to "weapon" it was the same =\
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #15  
Old 09-07-2007, 07:17 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I've always used 'gui': it's shorter
Reply With Quote
  #16  
Old 09-07-2007, 09:33 PM
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 Switch View Post
Oh really? When I changed "gui" to "weapon" it was the same =\
It doesn't make any difference.
__________________
Stan.
Reply With Quote
  #17  
Old 09-08-2007, 03:59 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by Kyranki View Post
It doesn't make any difference.
Ya think?

I kinda noticed it when I changed it
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
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 06:59 PM.


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