Jump to content
  • 0

dont allow player to summon more than 1 npc at time


Question

Posted

Hi, i have npc buffer which can be summoned with skill. problem is player can summon how many he wants at same time.

how can i fix it? if already summoned one buffer need to disable skill or something to prevent summon second buffer.

2 answers to this question

Recommended Posts

  • 0
Posted

I did not get answer here so I found little trick, maybe there is better ways I don't know.

 

I needed to know if player have already summoned one NPC or not, I needed 1 property from players creature data, I used summoner_id for it because I don't think server will use this property,

player don't have summoner right? so we can store summoned NPCs id temporary there. inside CREATED event i added this:

 

if(myself.sm.master.summoner_id != 0){
            SendScriptEventEx(GetCreatureFromID(myself.sm.master.summoner_id),0,0,-7);
            myself.sm.master.summoner_id = myself.sm.id;
            
        }
        else{
            myself.sm.master.summoner_id = myself.sm.id;
        }

 

 

checking if masters.summoner_id != 0 then it = that summoned NPC id which means player already have one NPC buffer summoned so I decided to unsummon old one and summon new,

 

I get creatureData of old NPC buffer and send script event  with -7, you can send whatever you want:

this part > SendScriptEventEx(GetCreatureFromID(myself.sm.master.summoner_id),0,0,-7);

 

and implemented SCRIPT_EVENT listener in buffer NPC ai

EventHandler SCRIPT_EVENT(script_event_arg1, script_event_arg2, script_event_arg3) {
		if (script_event_arg3 == -7) {
			Despawn();
		}
	}

 

if NPC will receive script event in my case with -7 it will despawn.

 

thats it when player will use skill that summons this NPC, if player already have one summoned old will dissapear and new will be summoned.

 

don't forget to set myself.sm.master.summoner_id = 0;

to 0 again when unsummoning NPC by yourself, to be able summon NPC again...

don't worry if player go offline when player restarts master.summoner_id will be 0 again.

 

 

Admin Lock it.

 

 

 

Guest
This topic is now closed to further replies.


  • Posts

    • Vilmis is the biggest scammer in history. He bans his members when they complain about something. I know more than one who's banned him. He updates shit, but he charges you like he's doing something serious.
    • I did not want to, but I will tell a few things (just because of other members that might understand something wrong): 1. Nothing held as hostage some kinda customer of yours. I think even now could find your donate panel code at my source code. So, stop spreading a lie because of your head progressive diseases. 2. Don't use my old customer's post as counterargument. We all had the worst customers which think they are the righest ones no matter what. He was one of them. He caused a lot of problems to me. Also, he was rude and disrespectful. 3. You're just simply hater. No matter what good I'm gonna say you gonna say in reverse. Smarter people sees the truth. 4. Look, you don't like me, I don't like you, but it's unnecessary to comment all post about my project and write everything worst just because you hate me. 😉
    • I've seen this many times, to be honest, let's hope that this time it will actually happen. I would suggest building something that helps develop trust within the community's sales. It could be something similar to FunPay, for example, which ensures secure trades for both the seller and the buyer, along with a rating system for both parties. I would also recommend doing something about the voting site, which has been paused for I don't know how many years since the Fiverr failure. Last but not least, I’d suggest creating an open blog or at least publishing weekly articles that can attract more people to the forum or encourage members to return and read them. The topics of these articles could include overviews and opinions on L2 or GTA V servers, PUBG, Fortnite, tech news, coding updates, or even general news that the author finds interesting.   How could you know such an information? 🤔 And yeah I agree on the part about the poor management
    • ➡ Discount for your purchase: JUNE2025 (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • there are extenders that already have all that included ingame 🙂 for example GX-EXT
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock