Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Not counting deaths (https://forums.graalonline.com/forums/showthread.php?t=134257257)

sssssssssss 12-11-2009 04:49 AM

Not counting deaths
 
I have this script for sword only areas. In the areas where this weapon is added, deaths will not count. Any idea why?

PHP Code:

function onCreated() join("weapon_functions");

//#CLIENTSIDE

function onCreated()
{
  
enableweapons();
  
client.swordOnly true;
  
//s+a, ect disabled in -*System
  
player.ap += 50;
  
player.hearts 6;
  
player.ap -= 50;
  
disablemap(); 
  
disablepause(); 
  
disableselectweapons();
  
disableselectitems();
}

//keep this here, hearts are resetting when player dies
function onPlayerDies()
{
  
player.ap += 50;
  
player.hearts 6;
  
player.ap -= 50;
}

function 
onPlayerEnters()
{
  
player.ap += 50;
  
player.hearts 6;
  
player.ap -= 50;
  
  if (
client.swordOnly)
  {
    
disableweaponselect(); 
    
player.selectedweapon findWeaponIdthis );
  }
  else {
    
//Disabled; trying to fix the enablefeatures mess. I don't think removing this will break anything.
    //enablefeatures(allfeatures);
    
enablemap(); 
    
enablepause(); 
    
enableweapons(); 
    
enableselectweapons();
    
enableselectitems();
    
destroy();
  }



fowlplay4 12-11-2009 05:09 AM

Well they are brought back to life right away, so perhaps the death isn't registering.

sssssssssss 12-11-2009 05:21 AM

Its not,I've commented that out already, still does it.

This is the only other script part that has to do with the weapon really, it just disables certain things, and is where our enablefeatures stuff is.


PHP Code:

  if (player.level.name in this.levelnamez)
  {
    
//Settings for PK/Sparring/War arenas.
    
    
temp.features allfeatures 0x10 0x20 0x80;
    
    if (
"functions_options" in player.joinedclasses)
    {
      if (
player.getOptionsVariable("hidehearts")) temp.features -= 0x100;
      if (
player.getOptionsVariable("hidenicks")) temp.features -= 0x200;
    }
    
    
enablefeatures(temp.features);
    
    
client.swordOnly true;
    
triggerServer("weapon"this.name"remSwordWep");
  }
  else {
    
//Normal settings, disabling old inventory
    
    
enablefeatures(allfeatures 0x80);
    
    
client.swordOnly false;
    
triggerServer("weapon"this.name"addSwordWep");
  } 


There is an array of levels, and in those levels, this code is activated. It goes hand in hand with the SwordOnly script in the first post. The server trigger is to add or remove SwordOnly.

cbk1994 12-11-2009 05:27 AM

I'm guessing it's because this script is used in a sparring zone. Deaths don't count in sparring zones.

sssssssssss 12-11-2009 05:29 AM

It's not. I wish it was that easy...

This is in a spar, as well as pk and war arenas as posted in the second code snippet.
The pk and war arenas are not set up as sparring zones.


All times are GMT +2. The time now is 04:18 AM.

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