PDA

View Full Version : quest::delglobal();


blackdragonsdg
11-18-2010, 06:51 PM
Does quest::delglobal(); still work?

All examples of usage I have seen show it being used like this:

quest::delglobal([varname]);

Now if that is true then this should work:

Test.pl
sub EVENT_SAY {

if($text=~/Hail/)
{
quest::setglobal("Hailed_NPC", 1, 5, "F");
$client->Message(4,"You receive character flag....Hailed_NPC");
quest::setglobal("Hailed_NPC_2", 1, 5, "F");
$client->Message(4,"You receive character flag....Hailed_NPC_2");
$client->Message(4,"If you ask me to [remove these character flags] and I will do so.");
}
if($text=~/remove these character flags/)
{
quest::delglobal("Hailed_NPC");
$client->Message(4,"The character flag Hailed_NPC has been removed.");
quest::delglobal("Hailed_NPC_2");
$client->Message(4,"The character flag Hailed_NPC_2 has been removed.");
}
}

The problem is that script doesn't completely work...it stops at quest::delglobal("Hailed_NPC");

I have also tried writing it like this quest::delglobal(Hailed_NPC); and quest::delglobal([Hailed_NPC]); but I end up with the same result everytime.

I can comment out the quest::delglobal(); and it will work flawlessly. I can create and mofify qglobals but I can not delete them. I made sure to set the qglobal field for the npc so I know that isn't it.

What I am missing or doing wrong?

steve
11-19-2010, 03:02 PM
Did you try a global name that does not have an underscore?

Searching of older posts show that you are using the syntax correctly.

blackdragonsdg
11-19-2010, 04:09 PM
Turns out it was the underscores that caused it not to work. That is odd because both setglobal and targlobal work when using underscores. Thanks for the help.