Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-31-2010, 08:52 PM
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
Well, quick glance over:

if (player.chat = "Testdestination") {

=, is an assignment i.e: a = 1;
==, is a comparison. i.e: player.chat == "yes!";

You should be doing comparisons in if statements.

Also I would recommend just setting:

client.destination = "Test destination";

Instead of setting actual level coordinates that could easily be changed with a memory editor, then on the serverside you'd have to a simple check.

PHP Code:
function onActionServerSide() {
  if (
params[0] == "arrive") {
    
// Determine coordinates from the destination
    
if (client.destination == "Test destination") {
      
temp.coordinates = {"onlinestartlocal.nw"3030};
    }
    else if (
client.destination == "some other place") {
      
temp.coordinates = {"onlinestartlocal.nw"3030};
    }
    
// Make sure coordinates were set.
    
if (temp.coordinates != NULL) {
      
// Warp player
      
player.setlevel2(temp.coordinates[0], temp.coordinates[1], temp.coordinates[2]);
    }
  }

But that was assuming you were using it in a weapon npc, oh well.
__________________
Quote:
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:31 AM.


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