ID:263420
 
Code:
obj
Cards
Monster
Test
typePath=/obj/Cards/Monster/Test
name="Earth Monster"
icon_state="test"
Click(src)
if(usr.canPlay)
if(usr.spot1==0)
new typePath(usr.loc)
usr.spot1=1
return
if(usr.spot2==0)
new typePath(usr.x-1,usr.y+1,usr.z)
usr.spot2=1
return
if(usr.spot3==0)
new typePath(usr.x,usr.y+1,usr.z)
usr.spot3=1
return
if(usr.spot4==0)
new typePath(usr.x+1,usr.y+1,usr.z)
usr.spot4=1
return
if(usr.spot5==0)
new typePath(usr.x+2,usr.y+1,usr.z)
usr.spot5=1
return
if(usr.spot1==1&&usr.spot2==1&&usr.spot3==1&&usr.spot4==1&&usr.spot5==1)
usr<<"You cannot play anymore cards."
owner=usr
else
world<<"Moo"


Problem description:
The card will appear over the player since spot1=0, but it won't appear in any other locations, even though they are equal to zero.

God that' horrible, use Boolean... please :(


Remember to read the comments carefully:
mob/var/tmp/list/spot[5]  //Creates a tmp. variabled list with an initial size of 5 .. helps save your variable count somewhat..so yeah, I am replacing your variables with this

obj
Cards
Monster
Test
typePath=/obj/Cards/Monster/Test
name="Earth Monster"
icon_state="test"
Click() //You do not need to define anything in the argument if it's not needed
if(!usr.canPlay)
world<<"Moo"
return //Stops the rest of the code from occurring
for(var/i=1 to 5) //Checks each spot from 1 - 5
if(!usr.spot[i]) //Checks if the spot position (spot #[i]) is empty
var/lck = usr.x //Stores where the card will show
switch(i)
if(2) lck-=1
if(4) lck+=1
if(5) lck+=2
lck = locate(lck, usr.y+(i>1? 1 : 0),usr.z) //Locates where card will be. X?Y:Z is a compact if statement, basically: if(X) {Y} else {Z}
var/Card/A = new typePath(lck)
usr.spot[i]=A //Might as well make the spots refer to the cards instead of a number..
A.owner = usr
return //Stops the rest of the code from happening
usr<<"You cannot play anymore cards."
The actual problem was you only defined a REAL location for card #1.. for the others... you forgot to add locate() around the variables [locate(x,y,z)] .. but I _think_ I made it a bit more efficient ;)

Read carefully, learn how, ask questions.

- GhostAnime
In response to GhostAnime
Thanks for the help :)
Oh, did you intentionally make A incorrect, to see if I even read the code, or just copied and pasted?