ID:142572
 
Code:
mob/Admin/verb
TakeAttk(M as mob)
set category = "Staff"
alert("if you abuse this power you will be banned"
if(M.attktook<3)
M.canattack = 0
M << "you cant attack for 1 min..."
sleep(600)
M.attktook+=1
else
M.canattack = 0
M << "you won't be abel to attack until an admin sais so.."
M.attktook+=1


Problem description:
umm
somthing wrong with if(M.attktook<3)
how do i fix it >_<
</3>
RanEsu wrote:
Code:
mob/Admin/verb
> TakeAttk(M as mob)
> set category = "Staff"
> alert("if you abuse this power you will be banned") //it was never closed
> if(M.attktook <= 3) //this what you want? LESS then 3?
> M.canattack = 0
> M << "you cant attack for 1 min..."
> sleep(600)
> M.attktook+=1
> else
> M.canattack = 0
> M << "you won't be abel to attack until an admin sais so.."
> M.attktook+=1
>

Problem description:
umm
somthing wrong with if(M.attktook<3)
how do i fix it >_<
In response to Eternal Desire
_> you didn't say anything?
In response to RanEsu
RanEsu wrote:
_> you didn't say anything?
read comments and look at what i editted.
Your alert() is missing both closing parenthesis and arguments (your alert box will have no title).
In response to Eternal Desire
oh i see what u did... wow im dumb... lol
In response to RanEsu
staff.dm:25:error:M.attktook:undefined var
staff.dm:26:error:M.canattack:undefined var
staff.dm:29:error:M.attktook:undefined var
staff.dm:31:error:M.canattack:undefined var
staff.dm:33:error:M.attktook:undefined var

///////////////////////
//this is in staff.dm//
///////////////////////
mob/Admin/verb
TakeAttk(M as mob)
set category = "Staff"
alert("if you abuse this power you will be banned")
if(M.attktook<3)
M.canattack = 0
M << "you cant attack for 1 min..."
sleep(600)
M.attktook+=1
else
M.canattack = 0
M << "you won't be abel to attack until an admin sais so.."
M.attktook+=1
//////////////////////
//this is in vars.dm//
//////////////////////
mob/var
canattack=1
attktook=0
In response to RanEsu
Change:

TakeAttk(M as mob)

To:

TakeAttk(mob/M as mob)

So that Dream Maker knows you're working with a mob which has the correct mob vars, not just a variable called M.
In response to Eternal Desire
<= means less then OR equal...
< means less than
In response to Foomer
ty