ID:165383
 
Is it posible to make a verb to let the player make a copy of himself ?
Yes, you can. If you want it to be an exact copy, you can just create a new object with the same type path as the player, and copy all of the important variables (skipping a couple of internal ones such as 'client' or 'key'). To do this, you have to loop through the 'vars' list all objects have.

var/list/skip_vars = list("type","vars","key","ckey","client")
// list of variables to skip when cloning

mob/verb
clone_self()
var/mob/M = new src.type (src.loc)
// create a new object with the same type as the player

for(var/i in M.vars) // loop through all of the variables the clone has
if(i in skip_vars) continue // skip all of the unnecessary and internal variables that should not be copied over
M.vars[i] = src.vars[i] // otherwise, copy the same values of the variables
You'r code dosent work when i run it its unable to determine the atom type.
In response to Miran94
No, his code is fine, but he missed some vars in the 'skip' list - you will get some "can't write to var" errors, etc.
Anyway, before making topics, search first. There are probably tons of topics about this. [link]

Examples to go with that proc:
mob/verb
create_clone1()
/*this approach doesn't specify a datum to copy over to,
therefore the proc creates a new one of the same type
as the cloned datum, in this case a /mob*/

src.Copy()
src << "You create a clone!"
create_clone1_x()
//this just demonstrates the usefulness of the proc returning\
the object reference

var/mob/clone = src.Copy()
clone.name = "[src]'s clone"
clone.loc = get_step(src,src.dir)
create_clone_2()
//this approach instructs the proc to copy over to a \
'custom' (existing) datum.

var/mob/clone = new()
src.Copy(clone)
clone.name = "[src]'s clone"
clone.loc = get_step(src,src.dir)