View Single Post
  #3  
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