Virtual world (player.world)

Started by Shovon^, Sep 09, 2016, 04:55 PM

Previous topic - Next topic

Shovon^

i want help like i want to create a cmd then if i write that cmd i will be in another virtual world i wanna use player.world for that can anyone help....
Iam the best and i only believe in Allah

Conatact me here on IRC:  #shovon^ @LUnet

KAKAN

if( cmd == "changemyworld" ) player.World = 2;
oh no

Shovon^

can i do like this tht i added robbing system only in world2 and get join msges if they go there??
Iam the best and i only believe in Allah

Conatact me here on IRC:  #shovon^ @LUnet

KAKAN

Quote from: Shovon^ on Sep 09, 2016, 05:10 PMcan i do like this tht i added robbing system only in world2 and get join msges if they go there??
yup
take this as an example:-
make a function like this:-
CPlayer::ChangeWorld( World ){
::onPlayerWorldChange( this, this.World, World );
this.World = World;
}
now, lets get to the event.
function onPlayerWorldChange( player, oldWorld, newWorld ){
if( oldWorld != 2 && newWorld == 2 ) Message( player + " has joined Robbing city." );
else Message( player + " has changed his/her world from " + oldWorld + " to " + newWorld );
}
now, the command part.
if( cmd == "mycmd" ) player.ChangeWorld( 2 );Hope you get me :)
oh no

Shovon^

thnx but how will i add robbing functions starts only when that player joins there
Iam the best and i only believe in Allah

Conatact me here on IRC:  #shovon^ @LUnet

KAKAN

Quote from: Shovon^ on Sep 10, 2016, 07:14 AMthnx but how will i add robbing functions starts only when that player joins there
add it to your command. That's not what the topic is about.
oh no

Shovon^

Iam the best and i only believe in Allah

Conatact me here on IRC:  #shovon^ @LUnet