mrwolv 46 Posted January 24, 2019 (edited) i used to use a chunk of code in my mp mission init.c and it used to call out the ammount of players perfectly on the server when they connect here is the code //Player Call Start// override void OnInit() { GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(NumPLayersOnServer, 300000, true); // 30 seconds } void NumPLayersOnServer() { ref array<Man> players = new array<Man>; GetGame().GetPlayers( players ); int numPlayers = players.Count(); for ( int i = 0; i < players.Count(); ++i ) { Man player = players.Get(i); if( player ) { string messPlayers = "Players on the server: " + numPlayers.ToString(); Param1<string> m_MessageParam = new Param1<string>(messPlayers); GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity()); } } } //Player Call End// but i have added the trader mod to my server now and this stops the trader mod working is there a mod or plugin that will solve this for me as i want it to call players out when they join the server thanks Edited January 25, 2019 by mrwolv Share this post Link to post Share on other sites
HeadCrabD 5 Posted January 25, 2019 How do you use this code.. Put this on top of init.c seems not working at all Share this post Link to post Share on other sites
mrwolv 46 Posted January 25, 2019 you add it under class CustomMission: MissionServer but if you use the trader plugin it will break the plugin for you but it dose work class CustomMission: MissionServer { //Player Call Start// override void OnInit() { GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(NumPLayersOnServer, 300000, true); // 30 seconds } void NumPLayersOnServer() { ref array<Man> players = new array<Man>; GetGame().GetPlayers( players ); int numPlayers = players.Count(); for ( int i = 0; i < players.Count(); ++i ) { Man player = players.Get(i); if( player ) { string messPlayers = "Players on the server: " + numPlayers.ToString(); Param1<string> m_MessageParam = new Param1<string>(messPlayers); GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity()); } } } //Player Call End// 1 Share this post Link to post Share on other sites
HeadCrabD 5 Posted January 25, 2019 45 minutes ago, mrwolv said: you add it under class CustomMission: MissionServer but if you use the trader plugin it will break the plugin for you but it dose work class CustomMission: MissionServer { //Player Call Start// override void OnInit() { GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(NumPLayersOnServer, 300000, true); // 30 seconds } void NumPLayersOnServer() { ref array<Man> players = new array<Man>; GetGame().GetPlayers( players ); int numPlayers = players.Count(); for ( int i = 0; i < players.Count(); ++i ) { Man player = players.Get(i); if( player ) { string messPlayers = "Players on the server: " + numPlayers.ToString(); Param1<string> m_MessageParam = new Param1<string>(messPlayers); GetGame().RPCSingleParam(player, ERPCs.RPC_USER_ACTION_MESSAGE, m_MessageParam, true, player.GetIdentity()); } } } //Player Call End// Beans for u. Now Working perfectly 1 Share this post Link to post Share on other sites