ID:267226
 
I was wondering if their is a way to make a person not playing play or take control of the playing player.....
src.mob = M
M.mob = null
In response to Garthor
so say I put this....

mob
verb
Take_Over(mob/M)
src.mob=M
M = null

this would allow the person playing choose who gets to play and SWITCH them.. not delete them right?
In response to Shy_guy197
No...

mob/verb/Take_Over(mob/M)
var/client/C = M.client
C.mob = null
client.mob = M
C.mob = src
In response to Garthor
I'll try it out... but if you could stick around so I can reply to tell you it works... that's if your not busy
In response to Shy_guy197
hey it worked but I get an error something about mob... now I don't have an icon for the mob... that might be the prob... also is there a way to make have one persons vars change to the other persons vars?
In response to Shy_guy197
Would something like M.var=client.var work? I'm not really sure but you can try it.
In response to ADDiCt
sounds like an idea
In response to Shy_guy197
no didn't work... I did do

M.vars=usr.vars but it said it couldn't change constant value...
In response to Shy_guy197
I mean't I need it to switch a player with another player...

exp:
A person is playing and another is only watchin not being able to move... If the person playing presses a button and he chooses for that other person to take over where ever he is... it just switchs all the person playing vars to the person not playing and lets the person not playing control that person playing... and there names stay the same... not making any one of them null.... and if the person playing gets tired he just switchs again...

_>, <_<, I dunno if anyone will understand what I wrote...
In response to Shy_guy197
mob/verb/Switch(mob/M)
var/client/MC = M.client
var/client/C = client //Holds the clients in variables, because they will be jumping around.
var/S = M.name //Holding the name
M.name = src.name
src.name = S //Swapping the names
MC.mob = null
C.mob = M
MC.mob = src //Switching between the mobs


That should work. Remember, Logout() and Login() will be called for both mobs every time you use this, so you might want to move things from Login() to client.New() and Logout() to client.Del().
In response to Garthor
THX I hope this works
In response to Shy_guy197
This error is when person I switched with presses to switch me back to playing position.. this also makes my name the person pressing switch..

runtime error: Cannot modify null.mob.
proc name: Switch (/mob/PLAYER/verb/Switch)
usr: Shy_guy197 (/mob)
src: Shy_guy197 (/mob)
call stack:
Shy_guy197 (/mob): Switch(Blade2190 (/mob))

This is when person I switched with presses again trying to switch back with me... my name switchs back to my normal name....

runtime error: Cannot modify null.mob.
proc name: Switch (/mob/PLAYER/verb/Switch)
usr: Blade2190 (/mob)
src: Blade2190 (/mob)
call stack:
Blade2190 (/mob): Switch(Shy_guy197 (/mob))

I believe what it's doing is making me null or making the person using it null
In response to Shy_guy197
also to add when the person switchs the person taking the playing person space gets the Switch Verb..... so the person not playing doesn't get the verb any more....
In response to Shy_guy197
That mean no one knows?