Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #QUEST part...
- if (plugin::check_hascount($client, 160002, 20)) { #Checking to see if we have 20 stack of item 160,002 anywhere in current inventory
- plugin::collect_quest($client, 160002, 20);
- $client->Message(335, "Removing 20 of 160002 from your inventory");
- } else {
- $client->Message(335, "You do not have the required amount in a correct stack size!");
- }
- #PLUGIN PART...
- #checks to see if player has item
- #useage plugin::check_hasitem($client, itemid);
- sub check_slot {
- my $client = shift;
- my $itmchk = shift;
- my $slot1;
- my $itemid1;
- my $augid1;
- my $i;
- my $body_count = $client->GetCorpseCount();
- my $body_id;
- #Check main inventory and cursor
- for($slot1=0; $slot1<=30; $slot1++) {
- $itemid1=$client->GetItemIDAt($slot1);
- for($i=0; $i<5; $i++) {
- $augid1=$client->GetAugmentIDAt($slot1, $i);
- if($augid1==$itmchk) {
- return $slot1;
- }
- }
- if($itemid1==$itmchk) {
- return $slot1;
- }
- }
- #Check main inventory's and cursor's containers
- for($slot1=251; $slot1<=340; $slot1++) {
- $itemid1=$client->GetItemIDAt($slot1);
- for($i=0; $i<5; $i++) {
- $augid1=$client->GetAugmentIDAt($slot1, $i);
- if($augid1==$itmchk) {
- return $slot1;
- }
- }
- if($itemid1==$itmchk) {
- return $slot1;
- }
- }
- #Check bank slots
- for($slot1=2000; $slot1<=2023; $slot1++) {
- $itemid1=$client->GetItemIDAt($slot1);
- for($i=0; $i<5; $i++) {
- $augid1=$client->GetAugmentIDAt($slot1, $i);
- if($augid1==$itmchk) {
- return $slot1;
- }
- }
- if($itemid1==$itmchk) {
- return $slot1;
- }
- }
- #Check bank's containers
- for($slot1=2030; $slot1<=2270; $slot1++) {
- $itemid1=$client->GetItemIDAt($slot1);
- for($i=0; $i<5; $i++) {
- $augid1=$client->GetAugmentIDAt($slot1, $i);
- if($augid1==$itmchk) {
- return $slot1;
- }
- }
- if($itemid1==$itmchk) {
- return $slot1;
- }
- }
- #Check shared bank
- for($slot1=2500; $slot1<=2501; $slot1++) {
- $itemid1=$client->GetItemIDAt($slot1);
- for($i=0; $i<5; $i++) {
- $augid1=$client->GetAugmentIDAt($slot1, $i);
- if($augid1==$itmchk) {
- return $slot1;
- }
- }
- if($itemid1==$itmchk) {
- return $slot1;
- }
- }
- #Check shared bank's containers
- for($slot1=2531; $slot1<=2550; $slot1++) {
- $itemid1=$client->GetItemIDAt($slot1);
- for($i=0; $i<5; $i++) {
- $augid1=$client->GetAugmentIDAt($slot1, $i);
- if($augid1==$itmchk) {
- return $slot1;
- }
- }
- if($itemid1==$itmchk) {
- return $slot1;
- }
- }
- #Check corpses
- # if ($body_count > 0) {
- # for ($i=1; $i<=$body_count; $i++) {
- # $body_id = $client->GetCorpseID($i);
- # for ($slot1=0; $slot1<=30; $slot1++) {
- # $itemid1 = $client->GetCorpseItemAt($body_id, $slot1);
- # if ($itemid1 == $itmchk) {
- # return $slot1;
- # }
- # }
- # for ($slot1=251; $slot1<=340; $slot1++) {
- # $itemid1 = $client->GetCorpseItemAt($body_id, $slot1);
- # if ($itemid1 == $itmchk) {
- # return $slot1;
- # }
- # }
- # }
- # }
- return 0;
- }
- #plugin::check_hascount($client, itemid, amountcheck)
- sub check_hascount {
- my $client = shift;
- my $itmchk = shift;
- my $COUNT = shift;
- my $slot1;
- my $itemid1;
- my $i;
- #Check main inventory (IGNORE CURSOR)
- for($slot1=0; $slot1<=29; $slot1++) {
- $itemid1=$client->GetItemIDAt($slot1);
- if($itemid1==$itmchk) {
- if($client->GetItemAt($slot1)->GetCharges() >= $COUNT) {
- return $slot1;
- }
- }
- }
- #Check main inventory's bags (IGNORE CURSOR BAGS)
- for($slot1=251; $slot1<=330; $slot1++) {
- $itemid1=$client->GetItemIDAt($slot1);
- if($itemid1==$itmchk) {
- if($client->GetItemAt($slot1)->GetCharges() >= $COUNT) {
- return $slot1;
- }
- }
- }
- return 0;
- }
- #plugin::collect_quest($client, itemid, amountcheck)
- sub collect_quest {
- my $client = shift;
- my $itmchk = shift;
- my $COUNT = shift;
- my $slot1;
- my $itemid1;
- my $i;
- #Check main inventory (IGNORE CURSOR) -- Cursor bugs the fuck out
- for($slot1=0; $slot1<=29; $slot1++) {
- $itemid1=$client->GetItemIDAt($slot1);
- if($itemid1==$itmchk) {
- if($client->GetItemAt($slot1)->GetCharges() >= $COUNT) {
- $client->DeleteItemInInventory($slot1, $COUNT, 1);
- return;
- }
- }
- }
- #Check main inventory's bags (IGNORE CURSOR BAGS) -- Cursor bugs the fuck out
- for($slot1=251; $slot1<=330; $slot1++) {
- $itemid1=$client->GetItemIDAt($slot1);
- if($itemid1==$itmchk) {
- if($client->GetItemAt($slot1)->GetCharges() >= $COUNT) {
- $client->DeleteItemInInventory($slot1, $COUNT, 1);
- return;
- }
- }
- }
- return 0;
- }
- 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement