PDA

View Full Version : if (GangTagSystem != Working) { //what do I do? }


Switch
09-06-2007, 02:41 AM
Name says it all. The script is here:

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.name, player.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
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
Well try
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.
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.name, null);
}
}
}
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
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
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:
strlen(string)
Please use:
string.length()

Like:
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
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
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
It doesn't make any difference.

Ya think?

I kinda noticed it when I changed it :p