Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Kid_Buu on Dec 28, 2017, 06:25 AM

Title: How can I see the players that are in a world?
Post by: Kid_Buu on Dec 28, 2017, 06:25 AM
Hello I wanted to request a system or something similar to see the users that are for example: in the world 1,2,3, etc.

Thank you for your attention :D
Title: Re: How can I see the players that are in a world?
Post by: umar4911 on Dec 28, 2017, 07:16 AM
Quote from: Kid_Buu on Dec 28, 2017, 06:25 AMHello I wanted to request a system or something similar to see the users that are for example: in the world 1,2,3, etc.

Thank you for your attention :D
if the players radar is on in the specific world and you are in that world too, you will be able to see him.
Title: Re: How can I see the players that are in a world?
Post by: Kid_Buu on Dec 28, 2017, 05:00 PM
is that I want to see the number of players that are in the world with a command
Title: Re: How can I see the players that are in a world?
Post by: Mohamed Boubekri on Jan 09, 2018, 07:41 PM
Quote from: Kid_Buu on Dec 28, 2017, 05:00 PMis that I want to see the number of players that are in the world with a command
I Think You Need it:-( UnTested )
else if ( cmd == "world" )
{
if ( !text ) MessagePlayer("[#ff0000][INFO][#ffffff] /world <Player>",player);
local plr = FindPlayer(text);
if(!plr) MessagePlayer("[#FF0000]Usage Error:[#FFFFFF] Unknown Player", player);
else
{
MessagePlayer("[#00ffff][INFO][#ffffff] World " + plr.Name + " is "+plr.World+".",player );
}
}
Title: Re: How can I see the players that are in a world?
Post by: umar4911 on Jan 11, 2018, 10:02 AM
try this, working
else if(cmd == "inworld")
{
if(!text) MessagePlayer("Error - Use /"+cmd+" [world id]", player);
else if(!IsNum(text)) MessagePlayer("Error - ID should be in number", player);
else
{
local v = 0;
for(local i=0; i <= GetMaxPlayers(); i++)
{
local plr = FindPlayer(i);
if(plr && plr.World == text.tointeger())
{
v = v+1;
MessagePlayer("Player : "+plr.Name, player)
}
}
if(v == 0) MessagePlayer("No one was in the world : "+text+".", player);
else MessagePlayer("Total player is World : "+text+" are : "+v+".", player);
}
}
Title: Re: How can I see the players that are in a world?
Post by: Kid_Buu on Jan 11, 2018, 05:08 PM
ohhhh thanks ;D