First you mark a zone as being "flagged" by setting the Flag column to 1 in the zone table. You could also put an item name in there, see Sebilis for an example of that.
Then in your quest script, you set the zone flag.
Here is an example from Tublik Narwethar in kodtaz that grants access to Qvic.
Code:
sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 60174 => 1)){
if (plugin::check_hasitem($client, 60252)) {
quest::say("You have done great things for us, but your journey is not yet over."); #need live text
$client->Message(4, "Finished! - You've recovered the Sliver of the High Temple! Congratulations!");
$client->Message(4, "You feel the magic protecting Qvic has softened.");
quest::summonitem(60176);
quest::setglobal("god_qvic_access",1,5,"F");
quest::set_zone_flag(295);
}
See the quest::set_zone_flag(295); that's it. 295 is the zoneidnumber for Qvic in the zone table, and Qvic has the flag_needed column set to 1.