Thank you for the input. I'm needing the player to return to the pvp state (derp just saw YOUR edit after my extensive editing lol) they were before they entered the contested zone. To paint the picture. I am having mischief be a pvp zone. upon entering you are forced pvp. now when you leave the zone I need it to return the player to their previous pvpstate, so if they were 0 then make them 0 but if they were state 1, leave them pvp. I was trying todo it in the player.pl in folder mischiefplane but due to not being able to share the global from EVENT ENTERZONE to EVENT ZONE, I believe it needs to be handled in global_player.
this is the current run after a few hours. it still doesn't initialize lol.
Oh c0ncrete I came across a post about perl -c filename.pl love it!
Code:
sub EVENT_ENTERZONE {
if(!defined $qglobals{PvPState}) {
if($client->GetPVP() == 1) {
quest::setglobal("PvPState", $PvP, 4, "F");
$client->Message(15, "pvp saved!");
if($zonesn =~ /^mischiefplane$/) {
$client->SetPVP(1);
$client->Message(15, "It's time for some Mischief, kill or be killed");
}
elsif ($PvP == $client->GetPVP(1)) {
$client->SetPVP(1);
$client->Message(15, "pvp on!");
}
else {
$client->SetPVP(0);
$client->Message(15, "pvp off!");
}
}
}
}