In response to Neimo
How i can count the number of summons i have at map??
In response to Kewerson93
When you summon them, either count down from 0 or count to a number, using the variable.
mob
verb
Summon()
var/cont=0
var/mob/npc/A = new /mob/npc/A
if(cont>=5)
usr<<"You can't summon anymore!"
else
A.loc = locate(usr.x,usr.y,usr.z)
A.name = usr.name
cont=cont+1


Like that?
In response to Kewerson93
The count would remain at 0 when checking through that if() statement, always. Create a variable that is attached to the mob and modify it.
In response to Neimo
attached to client mob?

mob
var
cont=0
verb
Summon()

var/mob/npc/A = new /mob/npc/A
if(cont>5)
usr<<"You cant summon anymore!"
else
A.loc = locate(usr.x,usr.y,usr.z)
A.name = usr.name
cont+=cont+1
In response to Kewerson93
Exactly, but when you're adding to the cont variable, you must do it like so:

cont ++
cont += 1
cont = cont + 1
In response to Neimo
Thank you.

mob
var
cont=0//Counter
cooldown=0//Cooldown check
verb
Summon()
var/mob/npc/A = new /mob/npc/A
if(cont>4) //Max amount of summons = 5
usr<<"You cant summon anymore!"
else if(cooldown==0) //Check skill Cooldown
A.loc = locate(usr.x,usr.y,usr.z) //Summon mob to the field
A.name = "[usr.name] Summon" //Set summon
cont++ //Increment
cooldown=1 //Skill goes in Cooldown.
spawn(50) cooldown=0 //After 5 seconds remove the cooldown.
spawn(300) del(A) //After 30 seconds delete the Summon
spawn(600) cont-- //After 60seconds remove 1 counter

In response to Kewerson93
Kewerson93 wrote:
Thank you.

> mob
> var
> cont=0//Counter
> cooldown=0//Cooldown check
> verb
> Summon()
> var/mob/npc/A = new /mob/npc/A
> if(cont>4) //Max amount of summons = 5
> usr<<"You cant summon anymore!"
> else if(cooldown==0) //Check skill Cooldown
> A.loc = locate(usr.x,usr.y,usr.z) //Summon mob to the field
> A.name = "[usr.name] Summon" //Set summon
> cont++ //Increment
> cooldown=1 //Skill goes in Cooldown.
> spawn(50) cooldown=0 //After 5 seconds remove the cooldown.
> spawn(300) del(A) //After 30 seconds delete the Summon
> spawn(600) cont-- //After 60seconds remove 1 counter


If mob dies before spawn(300) the npc summon will live forever.
In response to FIREking
How i can fix it?? :/
In response to Kewerson93
mob
var/summon_cooldown = 0, counter = 0
verb/Summon()
// check whether something is allowed or not
if(usr.counter >= 10 || usr.summon_cooldown > world.time)
return

var/mob/npc/m = new(usr.loc)
m.name = usr.name + "'s Summon"
usr.counter ++
usr.summon_cooldown = world.time + 50

spawn(300)
usr.counter --
// check whether the mob is still active
if(m)
del(m)
In response to Neimo
Thanks Neimo. It worked. :]

How i can remove my name and summon name from the list?
When creating the list, simply subtract your mob from the list.

var/list/L = hearers(usr) - usr
Woooow. Thank you again. :]

Edit: Summon name still on the list... :[
In response to Kewerson93
Just subtract m from the L list.
Page: 1 2