ID:150576
 
b_flag
icon = 'flags.dmi'
icon_state = "bflag"
verb
get()
set category = "Commands"
set src in oview(0)
if(icon == 'ctfred.dmi')
usr << "You get [src]"
Move(usr)
else
src << "You can't take your own flag!"

drop()
set category = "Commands"
if(icon == 'ctfred.dmi')
usr << "You drop [src]"
Move(usr.loc)
if(src.loc = locate(/area/rctf))
del(src)
Well trying to allow once the b_flag hits /area/rctf
to delete the flag. Thanx for any help.

Edited(Forgot to put the errors):
flags.dm:24:error::duplicate definition
flags.dm:39:error:src.loc:bad var
flags.dm:40:error:obj:value not allowed here
flags.dm:40:error::duplicate definition
Oblivian wrote:
b_flag
icon = 'flags.dmi'
icon_state = "bflag"
verb
get()
set category = "Commands"
set src in oview(0)
if(icon == 'ctfred.dmi')
usr << "You get [src]"
Move(usr)
else
src << "You can't take your own flag!"

drop()
set category = "Commands"
if(icon == 'ctfred.dmi')
usr << "You drop [src]"
Move(usr.loc)
if(src.loc = locate(/area/rctf))
del(src)
Well trying to allow once the b_flag hits /area/rctf
to delete the flag. Thanx for any help.

Edited(Forgot to put the errors):
flags.dm:24:error::duplicate definition
flags.dm:39:error:src.loc:bad var
flags.dm:40:error:obj:value not allowed here
flags.dm:40:error::duplicate definition

Im guessing this is a stupid question since no one is replying, please help! I need to know this :(
In response to Oblivian

Well trying to allow once the b_flag hits /area/rctf
to delete the flag. Thanx for any help.

´Not sure about the errors, but for that use Enter()

Like

area/rctf
Enter()
for(obj/b_flag in src.contents)
src.contents -= b_flag

or something similar

Alathon
In response to Alathon
Alathon wrote:
Well trying to allow once the b_flag hits /area/rctf
to delete the flag. Thanx for any help.

´Not sure about the errors, but for that use Enter()

Like

area/rctf
Enter()
for(obj/b_flag in src.contents)
src.contents -= b_flag

or something similar

Alathon

Thanx, but now I am getting a bad var.. used /obj/b_flag..

area/bctf
Enter()
for(/obj/b_flag in src.contents)
src.contents -= b_flag
flags.dm:43:error:b_flag:bad var
flags.dm:47:error:r_flag:bad var
flags.dm:42:error:/obj/b_flag:bad variable
flags.dm:46:error:/obj/r_flag:bad variable

why would I get a bad var?
In response to Oblivian
Oblivian wrote:
Alathon wrote:
Well trying to allow once the b_flag hits /area/rctf
to delete the flag. Thanx for any help.

´Not sure about the errors, but for that use Enter()

Like

area/rctf
Enter()
for(obj/b_flag in src.contents)
src.contents -= b_flag

or something similar

Alathon

Thanx, but now I am getting a bad var.. used /obj/b_flag..

area/bctf
Enter()
for(/obj/b_flag in src.contents)
src.contents -= b_flag
flags.dm:43:error:b_flag:bad var
flags.dm:47:error:r_flag:bad var
flags.dm:42:error:/obj/b_flag:bad variable
flags.dm:46:error:/obj/r_flag:bad variable

why would I get a bad var?

it has to do with the for line, im still a little skeptical on how its all set up, but try telling it what b_flag is, like before the for, var/tmp/b_flag = /obj/b_flag then the for loop SHOULD work

Alathon
In response to Alathon
Ok, this is probably getting very annoying(I know it is for me) but I almost have this figured out.

My current code is:

area/bctf
Enter()
if(icon == 'ctfblue.dmi')
var/tmp/b_flag = /obj/b_flag
for(b_flag in src.contents)
src.contents -= /obj/b_flag
usr.pk += 5
else
usr << "You have no flag to return."
area/rctf
Enter()
if(icon == 'ctfred.dmi')
var/tmp/r_flag = /obj/r_flag
for(r_flag in src.contents)
src.contents -= /obj/r_flag
usr.pk += 5
else
usr << "You have no flag to return."

This shows "You have no flag to return", even if I go into the opposing base to try to get their flag. How do I allow for me to get their flag?

In response to Oblivian
Oblivian wrote:
Ok, this is probably getting very annoying(I know it is for me) but I almost have this figured out.

My current code is:

area/bctf
Enter()
if(icon == 'ctfblue.dmi')
var/tmp/b_flag = /obj/b_flag
for(b_flag in src.contents)
src.contents -= /obj/b_flag
usr.pk += 5
else
usr << "You have no flag to return."
area/rctf
Enter()
if(icon == 'ctfred.dmi')
var/tmp/r_flag = /obj/r_flag
for(r_flag in src.contents)
src.contents -= /obj/r_flag
usr.pk += 5
else
usr << "You have no flag to return."

This shows "You have no flag to return", even if I go into the opposing base to try to get their flag. How do I allow for me to get their flag?

Instead of checking for icons, try setting a var, like Team. That might do it (doubt it) Dunno..it looks like it would work. Try putting src infront of the if as well if(src.Team == "Red")