Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Shovon^ on Sep 09, 2016, 04:55 PM

Title: Virtual world (player.world)
Post by: Shovon^ on Sep 09, 2016, 04:55 PM
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....
Title: Re: Virtual world (player.world)
Post by: KAKAN on Sep 09, 2016, 05:01 PM
if( cmd == "changemyworld" ) player.World = 2;
Title: Re: Virtual world (player.world)
Post by: Shovon^ on Sep 09, 2016, 05:10 PM
can i do like this tht i added robbing system only in world2 and get join msges if they go there??
Title: Re: Virtual world (player.world)
Post by: KAKAN on Sep 10, 2016, 05:36 AM
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 :)
Title: Re: Virtual world (player.world)
Post by: Shovon^ on Sep 10, 2016, 07:14 AM
thnx but how will i add robbing functions starts only when that player joins there
Title: Re: Virtual world (player.world)
Post by: KAKAN on Sep 10, 2016, 08:42 AM
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.
Title: Re: Virtual world (player.world)
Post by: Shovon^ on Sep 10, 2016, 08:45 AM
btw thnx