Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   can't figure out deletelevel() (https://forums.graalonline.com/forums/showthread.php?t=134266098)

Starfire2001 03-27-2012 01:39 AM

can't figure out deletelevel()
 
Here's a weapon script. It copies the level fine but then won't delete it. Help plz. :(

PHP Code:

function onActionServerSide(temp.dothis) {
  if(
temp.dothis == "CL"){
    
copylevel("ph8_test.nw""events/deletetest.nw");
    
player.chat "Triggered create";
  }
  elseif(
temp.dothis == "DL"){
    
deletelevel("events/deletetest.nw");
    
player.chat "Triggered delete";
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if(
player.chat == "copy level") {
    
triggerServer("gui"this.name"CL");
  }
  elseif(
player.chat == "delete level"){
    
triggerServer("gui"this.name"DL");
  }



fowlplay4 03-27-2012 02:04 AM

Try:

deletefile("levels/events/deletetext.nw");

If the (npcserver) doesn't have rw rights to the level then it won't be able to delete.

Starfire2001 03-27-2012 03:12 AM

Quote:

Originally Posted by fowlplay4 (Post 1690106)
Try:

deletefile("levels/events/deletetext.nw");

If the (npcserver) doesn't have rw rights to the level then it won't be able to delete.

Thanks, the npcserver not having rights was the problem!


All times are GMT +2. The time now is 01:46 AM.

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