Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   if (GangTagSystem != Working) { //what do I do? } (https://forums.graalonline.com/forums/showthread.php?t=76655)

Switch 09-06-2007 02:41 AM

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?

bscharff 09-06-2007 02:47 AM

if (strlen(#s(clientr.gang > 0))) {
can be changed to
if (clientr.gang > 0){
t does the same thing :P

PrinceOfKenshin 09-06-2007 02:49 AM

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);
    }
  }



Switch 09-06-2007 02:53 AM

Nope didn't work, Mike x_x

Inverness 09-06-2007 02:57 AM

Quote:

Originally Posted by PrinceOfKenshin (Post 1346050)
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.

PrinceOfKenshin 09-06-2007 03:43 AM

well strlen was in the commands.rtf for gs2 so i thought that was ok.

Kyranki 09-06-2007 03:59 AM

Why don't you just set the player's guild instead of doing all that with the nick? o_O

Inverness 09-06-2007 06:07 AM

Quote:

Originally Posted by Kyranki (Post 1346060)
Why don't you just set the player's guild instead of doing all that with the nick? o_O

Guild Rank :noob:

Inverness 09-06-2007 06:08 AM

Quote:

Originally Posted by PrinceOfKenshin (Post 1346058)
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.

zokemon 09-06-2007 04:51 PM

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 != "")

Switch 09-07-2007 12:08 AM

Thanks, it works now :)

Also, why'd you make it a "gui" [triggerserver("[I]gui[I]",.);]? It's supposed to be a weapon :p

DustyPorViva 09-07-2007 12:51 AM

Because weaponNPCs are considered gui's.

Inverness 09-07-2007 01:38 AM

Quote:

Originally Posted by DustyPorViva (Post 1346187)
Because weaponNPCs are considered gui's.

For some strange reason.

Switch 09-07-2007 02:24 AM

Oh really? When I changed "gui" to "weapon" it was the same =\

Twinny 09-07-2007 07:17 AM

I've always used 'gui': it's shorter ^^

Kyranki 09-07-2007 09:33 PM

Quote:

Originally Posted by Switch (Post 1346207)
Oh really? When I changed "gui" to "weapon" it was the same =\

It doesn't make any difference.

Switch 09-08-2007 03:59 PM

Quote:

Originally Posted by Kyranki (Post 1346337)
It doesn't make any difference.

Ya think?

I kinda noticed it when I changed it :p


All times are GMT +2. The time now is 12:43 PM.

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