Multiple item checker and nuker on EVENT_TARGET_CHANGE. Need help.
player.pl <--- Possible?
Code:
sub EVENT_TARGET_CHANGE { I put this in templates named as player.pl and it's purpose is to check 2 or more items on the player at once as soon as they switch targets and if they break this rule the nuke goes off and eliminates all of the items. (it's an anti-cheat for having items you're not supposed to.) This however is not working when I try it with a couple test items. Is there anyway to make this work? NOTE: The player is not allowed to have both of these items and that's why the anti cheat burns them. |
Need only 1 if and close your parenthesis
|
Quote:
Code:
sub EVENT_TARGET_CHANGE { |
Close...
Code:
if(plugin::check_hasitem($client, 4202) && plugin::check_hasitem($client, 4203)) |
And just a note: the way you have it only triggers if they have both.
|
Quote:
EDIT: I forget to close it originally, a small mistake but it's not working even closed below. Code:
#Player.pl Under the Wayfarer's message in Templates. |
Add some debugging information to the script to make sure it is even running. Add messages at each stage so you can see where it goes wrong, and simplify it into small steps you can test individually and then put them together.
|
This is goofy. Why does it do this?
THIS WILL PLAY A FANFARE AND NUKE THE CHOSEN ITEMS EVERY TIME A DIFFERENT TARGET IS CHOSEN OR DROPPED. Code:
# File is player.pl in the templates folder. THIS WILL NOT DO ANYTHING. THE PLUGIN IS CORRECT BECAUSE I TESTED IT ON A NPC INSTEAD OF PLAYER.PL Code:
# File is player.pl in the templates folder. So what in the world do I need to do to check for those items that it's not passing through to get to the next stage on EVENT_TARGET_CHANGE or is it impossible? |
Code:
# File is player.pl in the templates folder. If it shows nothing when you run it, then it's an issue with the emulator code and not a syntax error. |
lol, I made it bold in mine too, but making it giant is a sure win. :) <3 Secrets
|
The extra ) actually broke the script on the npc and wasn't needed. (I already said I tested this on an NPC with the single ")") It was fine as is. Thanks for trying to help though. This call doesn't work with this EVENT type so it's impossible to do with it. I asked if you all knew a way to get this to work but I doubt it. I'll have to figure something else out.
NOTE: If I knew the answer to something I would of already made a script for the person who was asking for help. If you want to show you're true tech gods that know anything it would be better if you actually showed it instead of act like I should know everything already. If I did I wouldn't be asking for help. "Closing" that isn't even needed. The extra "IF" was a mistake but the single ) was fine. Try the script for yourself on an NPC. |
First of all, with your attitude in your last reply, you really don't deserve further help. The answer has already been handed to you and you are complaining about that.
I tested the following script just now on a player.pl in my blackburrow zone and it worked perfectly fine. Code:
sub EVENT_TARGET_CHANGE { Also, anytime you have an opening parenthesis "(", or curly bracket "{", you always need a closing one that goes with that specific one. I highly recommend you download notepad++ for your script editing, because it will make it really easy for you to make sure you have your brackets and parenthesis properly closed. Just click next to the one you want to check and it highlights the other one in red. The people that were responding in this thread to help you have been doing this stuff for years, so they know what they are talking about. If you are still having a problem with that script, then your issue is most likely with the plugin itself. Maybe you don't have plugins in the correct folder. By default from PEQ, the plugin folder is inside the quest folder. You need to move it directly into your server folder for them to actually work. As mentioned earlier, you are using && in your example which means they need to have both items for the nuke item to happen. What you want is || for OR instead of AND. This should work: Code:
sub EVENT_TARGET_CHANGE { |
I didn't mean it as offensive, I was just pointing out a syntax error. Trevius' reply is right though, the script he posted should work.
I didn't mean to come of as a know-it-all. I just wanted to help. |
I use a shit load of check_hasitem plugins on my server, Trevius is 100% right!
|
I apologize if I came off rude. I'm just extremely stressed out right now with trying to fix this stuff up. I decided to make the first tier and higher path charms epic lore so now people can't have two of them in their inventory at once, however bots are bringing in a problem with being able to stash these charms. Trevius, Secrets, Lerxst, Joligaro, Oslander, thank you for your help.
Would you good folks know how to do away with unwanted items on bots by any chance? |
All times are GMT -4. The time now is 08:08 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.