Jump to content
  • 0

help patching up the bug hole in my script


joelolopez

Question


  • Group:  Members
  • Topic Count:  154
  • Topics Per Day:  0.03
  • Content Count:  493
  • Reputation:   46
  • Joined:  01/24/12
  • Last Seen:  

i made this no mvp pvp script that will not allow players with boss cards. the bug of this script is when an equipment with mvp card in it is not equipped while entering the pvp arena, the players are able to bypass my npc... i tried countitem() but it only recognize card ids that isn't inserted in any equipments ( e.g ghostring card), what i need in my script is to detect any equipment with mvp cards in it from my inventory... with that no one will able to bypass the mvp card restrictions

Edited by joelolopez
Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  154
  • Topics Per Day:  0.03
  • Content Count:  493
  • Reputation:   46
  • Joined:  01/24/12
  • Last Seen:  

 

Calm down guys :P

Try

	while ( .@i < @inventorylist_count ) {
		if ( @inventorylist_equip[.@i] == 0 && ( @inventorylist_card1[.@i] == 4305 || @inventorylist_card2[.@i] == 4305 || @inventorylist_card3[.@i] == 4305 || @inventorylist_card4[.@i] == 4305 ) ){
			mes "Can't allow you to continue.";
			close;
		}
		set .@i, .@i + 1;
	}
	// Once loop is finished, it will continue here.
	mes "Thank you Evelynn (:";
	close; 

but I prefer

	if ( isequippedcnt(4001) == 0 && ( checkequipedcard(4001) > 0 || countitem(4001) > 0 ) ) {// 4001 not equipped but 4001 inserted into an equipment or alone in the inventory
		mes "Can't allow you to continue.";
		close;
	}
	mes "Thank you Evelynn (:";
	close;

sir capuche im cool, i'll try to test this one thanks...

if ( isequippedcnt(4001) == 0 && ( checkequipedcard(4001) > 0 || countitem(4001) > 0 ) ) {// 4001 not equipped but 4001 inserted into an equipment or alone in the inventory

        mes "Can't allow you to continue.";

        close;

    }

    mes "Thank you Evelynn (:";

    close;

 

thanks sir capuche! it works!!!!!! (kneel) :3

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

 

 

you can use this.


*isequippedcnt(<item id>{,<item id>{,<item id>{,<item id>}}})

This function is similar to 'isequipped', but instead of 1 or 0, it will 
return the number of equipped items/cards in the list given that were found on the 
invoking character.

	if (isequippedcnt(4001,4005,4033,4196) == 4) mes "Finally got all four poring cards?";
	if (isequippedcnt(5353,2622) == 2) mes "You equipped both Helm of Sun and Earring.";

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  154
  • Topics Per Day:  0.03
  • Content Count:  493
  • Reputation:   46
  • Joined:  01/24/12
  • Last Seen:  

tnx emistry for the reply, but i think you didnt get wat im trying to say

 

how to produce this bug:

 

No MVP card PVP npc:

 

-npc will not allow you to enter the arena with ghost jacket equipped (jacket+ghostring card)

 

-and when they unequip the ghost jacket they will able to bypass the npc (after bypassing the npc, they will just put their equipments with mvp cards on) <---here is the big problem

 

-what i need is... even if the ghost jacket is unequiped the npc should detect any equipments with mvp cards in the inventory so that no player can bypass the npc

 

what i used is the countitem() but its not detecting mvp cards inside any equipments so i cross this out...

Edited by joelolopez
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   46
  • Joined:  03/27/13
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  154
  • Topics Per Day:  0.03
  • Content Count:  493
  • Reputation:   46
  • Joined:  01/24/12
  • Last Seen:  

yep, our problem is the same.. but the solution for the 1st problem in that topic isnt working for me..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   46
  • Joined:  03/27/13
  • Last Seen:  

 

yep, our problem is the same.. but the solution for the 1st problem in that topic isnt working for me..

 

 

Ain't this the solution to your problem?

 

 

// Checks if Equiped item has the turtle general card equiped for each individual slot ( 1-4 )

// If the ID of CARD SLOT of Equiped Item Position (2 = Weapon I believe ) is equal to 4035 ( Turtle General Card ID )

// I made it check all four card positions, First, Second, Third, and Fourth

 

// If the the Equiped Item at Position 2 ( Weapon's Position ) Card Slot's Item ID is Equal to 4035

// I reworded this so that it matches the argument positions...

if(getequipcardid(2,0) == 4305 || getequipcardid(2,1) == 4305 || getequipcardid(2,2) == 4305 || getequipcardid(2,3) == 4305) {
         mes "Can't allow you to continue";
         close;
}

 

It says: " Checks if Equipped item has the turtle general card equiped for each individual slot ( 1-4 ) " 

 

if(getequipcardid(2,0), 2 means it's the weapon's position as stated (But i believe it's actually 4 for weapon), and also according to const.txt in db folder, 5 value is for armor so if you'll make it like this:

if(getequipcardid(5,0) == GHOSTRING_CARD_ID

Then would it make sense that it'll check if the player's equipped ARMOR SLOT has GHOSTRING CARD?

 

And if he's gonna decard it and thinking to compound the ghostring card inside the non-mvp room, then:

 

 

 

// Checks if the Turtle General Card is inside your inventory by seeing if the item count for the Item ID 4305 ( Turtle General Card ) is greater than zero.
if(countitem(4305) > 0) {
         mes "Can't allow you to continue";
         close;
}

 

Where 4305 = Turtle general card ID

 

So i think that solves your problem.

Edited by Mary Magdalene
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  154
  • Topics Per Day:  0.03
  • Content Count:  493
  • Reputation:   46
  • Joined:  01/24/12
  • Last Seen:  

my major problem is how to detect mvp cards inside of the equipments ( not equipped. ) the solution 1 is not working

 

•Turtle general compounded with a bow in my inventory = mes "can't allow you to continue";

 

and the solution from the topic is

 

    while ( .@i < @inventorylist_count ) {
        if (@inventorylist_card1[.@i] == 4305 || @inventorylist_card2[.@i] == 4305 || @inventorylist_card3[.@i] == 4305 || @inventorylist_card4[.@i] == 4305){
            mes "Can't allow you to continue.";
            close;
        }
    set .@i, .@i + 1;

    }
// Once loop is finished, it will continue here.
mes "Thank you Evelynn (:";
close;

Edited by joelolopez
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

What about

	if (checkequipedcard(4001) > 0 || countitem(4001) > 0) {
		mes "Can't allow you to continue.";
		close;
	}
	mes "Thank you Evelynn (:";
	close;

Nb.

 

*checkequipedcard(<card id>)

This function will return 1 if the card specified by its item ID number is
inserted into any equipment they have in their inventory, currently equipped or
not.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  154
  • Topics Per Day:  0.03
  • Content Count:  493
  • Reputation:   46
  • Joined:  01/24/12
  • Last Seen:  

 

What about

	if (checkequipedcard(4001) > 0 || countitem(4001) > 0) {
		mes "Can't allow you to continue.";
		close;
	}
	mes "Thank you Evelynn (:";
	close;

Nb.

 

*checkequipedcard(<card id>)

This function will return 1 if the card specified by its item ID number is

inserted into any equipment they have in their inventory, currently equipped or

not.

 

sir capuche i need to make\ it like this

•.MvpCards compounded with a bow in my inventory = mes "MVP card is not allowed in this PVP";  (not equipped, just in the inventory)

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

@Jeololopez
have you ever tried any solutions that was proposed above ?? to me you're currently didnt tried any of it , and simply waiting for a complete spoonfeed.
in my post#2 , I mentioned to use isequippedcnt which could just solved your "check equipped card".
then again , Mary Magdelene also posted severall solutions to help you solve it, using the getequipcardid
afterward, you also posted the solution yourself. using the getinventorylist to check.
lastly Capuche, proposed another alternative checkequipedcard ... 
 
 
after all the solution, and you come up with a new post.

•.MvpCards compounded with a bow in my inventory = mes "MVP card is not allowed in this PVP";  (not equipped, just in the inventory)

So you want to check items that in a inventory ?? or compounded inside the equipment ?? or both ??
all the solutions has been proposed and shown.
 
What is the current issue ?? 
this is a script support section, and you keep telling there exist issue, but you never shown your script or what you have done in your script so far ...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  154
  • Topics Per Day:  0.03
  • Content Count:  493
  • Reputation:   46
  • Joined:  01/24/12
  • Last Seen:  

@Jeololopez

have you ever tried any solutions that was proposed above ?? to me you're currently didnt tried any of it , and simply waiting for a complete spoonfeed.

in my post#2 , I mentioned to use isequippedcnt which could just solved your "check equipped card".

then again , Mary Magdelene also posted severall solutions to help you solve it, using the getequipcardid

afterward, you also posted the solution yourself. using the getinventorylist to check.

lastly Capuche, proposed another alternative checkequipedcard ... 

 

 

after all the solution, and you come up with a new post.

•.MvpCards compounded with a bow in my inventory = mes "MVP card is not allowed in this PVP";  (not equipped, just in the inventory)

So you want to check items that in a inventory ?? or compounded inside the equipment ?? or both ??

all the solutions has been proposed and shown.

 

What is the current issue ?? 

this is a script support section, and you keep telling there exist issue, but you never shown your script or what you have done in your script so far ...

i already did the same solutions like the ones from the solutions above, and i know the basic script fuctions like counitem,is equipped.. etc... i'm not just waiting to have a spoonfeed emistry.

 

Mary Magdalene understand my issue, thats why he suggest that link to me..

 

but just like a said before i already did the same solutions like the ones from the solutions above.

 

and i got this solution for checking MVP cards from equipments while its not equipped(only in inventory): but it's still not working

 

   while ( .@i < @inventorylist_count ) {

        if (@inventorylist_card1[.@i] == 4305 || @inventorylist_card2[.@i] == 4305 || @inventorylist_card3[.@i] == 4305 || @inventorylist_card4[.@i] == 4305){

            mes "Can't allow you to continue.";

            close;

        }

    set .@i, .@i + 1;

    }

// Once loop is finished, it will continue here.

mes "Thank you Evelynn (:";

close;

 

 

im not making a new post here emistry, im trying my best to make it more clearer.  so that everybody can understand my issue and might get some help from all of you..from the start all i need is

 

i made this no mvp pvp script that will not allow players with boss cards. the bug of this script is when an equipment with mvp card in it is not equipped while entering the pvp arena, the players are able to bypass my npc... i tried countitem() but it only recognize card ids that isn't inserted in any equipments ( e.g ghostring card), what i need in my script is to detect any equipment with mvp cards in it from my inventory... with that no one will able to bypass the mvp card restrictions

 

in other words to make it more clearer

 

•.MvpCards compounded with a bow in my inventory = mes "MVP card is not allowed in this PVP";  (not equipped, just in the inventory)

 

 

oh boy, nevermind about this issue, im just going to fix this my self, thanks for the support section it helped a lot

Edited by joelolopez
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

show you current script progress if it doesnt work.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Calm down guys :P

Try

	while ( .@i < @inventorylist_count ) {
		if ( @inventorylist_equip[.@i] == 0 && ( @inventorylist_card1[.@i] == 4305 || @inventorylist_card2[.@i] == 4305 || @inventorylist_card3[.@i] == 4305 || @inventorylist_card4[.@i] == 4305 ) ){
			mes "Can't allow you to continue.";
			close;
		}
		set .@i, .@i + 1;
	}
	// Once loop is finished, it will continue here.
	mes "Thank you Evelynn (:";
	close; 

but I prefer

	if ( isequippedcnt(4001) == 0 && ( checkequipedcard(4001) > 0 || countitem(4001) > 0 ) ) {// 4001 not equipped but 4001 inserted into an equipment or alone in the inventory
		mes "Can't allow you to continue.";
		close;
	}
	mes "Thank you Evelynn (:";
	close;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...