Thread: Qglobal problem
View Single Post
  #7  
Old 06-25-2006, 11:21 PM
Muuss
Dragon
 
Join Date: May 2003
Posts: 539
Default

2 little suggestions.

Add parenthesis to your tests :

Code:
if (plugin::check_handin(\%itemcount, 51510 => 4) && ($zavious == 1))

Second one. This structure :
Code:
if (plugin::check_handin(\%itemcount, 51510 => 4) && $zavious == 1) {

} elsif (plugin::check_handin(\%itemcount, 69977 => 1) && $zavious == 3) {

} else {
  plugin::return_items(\%itemcount);
}
Will lead to some issues with item turn in and items returned.
The tests with check_handin remove items from the list of handed items if it succeded. In that case, lets say for your first test, if the player gives 4x51510 but $zavious is not set to 1, the test will fail and he WONT get his items back (because check_handin succeded).

2 possibilities :
Code:
if (($zavious==1) && plugin::check_handin(\%itemcount, 51510 => 4)) {
or

Code:
if ($zavious==1) {
  if (plugin::check_handin(\%itemcount, 51510 => 4)) {

  }
} elsif ($zavious==3) {
  if (plugin::check_handin(\%itemcount, 59977=>1)) {

  }
}
plugin::return_items(\%itemcount);
If the tests $zavious==2 stil don't work, you could try with ($zavious eq "2")...
__________________
Muuss - [PEQGC] Dobl, the ogre that counts for 2 !
http://www.vilvert.fr/page.php?id=10
Reply With Quote