Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    Nov 2011
    Location
    Germany
    Posts
    154

    [BF4] Insane Limits & VIP Slot Manager: VIP Slot for Help Server Start v1.0

    VIP Slot for Help Server Start for Insane Limits & VIP Slot Manager [BF4]

    With this script you can reward anyone with a reserved slot who help start your server


    ATTENTION:
    1) You need Insane Limits and VIP Slot Mananger (https://forum.myrcon.com/showthread....P-Slot-Manager)
    2) You must set iPlayerToCopy in CODE#1 and CODE#2


    SETUP LIMIT#1
    limit_evaluation: OnJoin
    limit_first_check: Code
    limit_first_check_code: paste the CODE#1 here

    CODE#1
    Code:
    // number of players to be copied to reserve list
    int iPlayerToVip = 10;
    
    // when the players list is copied over
    int iPlayerToCopy = 20;
    
    // number of days rewarded for helping to start the server
    int iRewardDays = 3;
    
    // show events at procon chat
    // yes = true | no = false
    bool bShowToProcon = true;
    
    
    /////////////
    // dont edit
    /////////////
    
    int iVipSlotCreated = 0;
    if (server.Data.issetInt("vipSlotCreated")) iVipSlotCreated = server.Data.getInt("vipSlotCreated");
    
    if (!server.Data.issetObject("vipPlayerList")) server.Data.setObject("vipPlayerList", new List<String>());
    List<String> lVipPlayerList = (List<String>)server.Data.getObject("vipPlayerList");
    
    // add player to temp reserve list
    if (server.PlayerCount < iPlayerToCopy && iVipSlotCreated == 0) {
    	
    	// add new player
    	lVipPlayerList.Add(player.Name);
    	
    	// show temp reserve list
    	String sVipPlayerList = String.Join(", ", lVipPlayerList.ToArray());
    	if (bShowToProcon) plugin.PRoConChat("^b^1VIPSlots^0^n: Player ( " + lVipPlayerList.Count + " ) " + sVipPlayerList);
    
    // create vips
    } else if  (server.PlayerCount == iPlayerToCopy && iVipSlotCreated == 0) {
    
    	// stop creating reserve list
    	server.Data.setInt("vipSlotCreated", 1);
    	
    	// create reserve slots
    	if (bShowToProcon) plugin.PRoConChat("^b^1VIPSlots^0^n: Create VIP-Slots for:");
    	List<String> ReservervedSlots = plugin.GetReservedSlotsList();
    	for (int i = 0; i < lVipPlayerList.Count; i++){
    		if (i == iPlayerToVip) break;
    		
    		// check if player has reserve slot
    		String sPlayerMessage = null;
    		if (ReservervedSlots.Contains(lVipPlayerList[i])) {
    			sPlayerMessage = "Thanks for help to start server, " + lVipPlayerList[i] + "! +" + iRewardDays + " days for your VIP slot";
    			plugin.SendPlayerMessage(lVipPlayerList[i], sPlayerMessage);
    			plugin.SendPlayerYell(lVipPlayerList[i], sPlayerMessage, 5);
    		} else {
    			sPlayerMessage = "Thanks for help to start server, " + lVipPlayerList[i] + "! You have now a VIP slot";
    			plugin.SendPlayerMessage(lVipPlayerList[i], sPlayerMessage);
    			plugin.SendPlayerYell(lVipPlayerList[i], sPlayerMessage, 5);
    		}
    		
    		// add player to reserve list
    		plugin.SendGlobalMessage("/vsm-addvip " + lVipPlayerList[i] + " +" + iRewardDays);
    		if (bShowToProcon) plugin.PRoConChat("^b^1VIPSlots^0^n: (" + (i+1) + ")" + lVipPlayerList[i]);
    	}
    }
    return false;
    SETUP LIMIT#1
    limit_evaluation: OnLeave
    limit_first_check: Code
    limit_first_check_code: paste the CODE#2 here

    CODE#2
    Code:
    // when the players list is copied over
    int iPlayerToCopy = 20;
    
    // show events at procon chat
    // yes = true | no = false
    bool bShowToProcon = true;
    
    
    /////////////
    // dont edit
    /////////////
    
    int iVipSlotCreated = 0;
    if (server.Data.issetInt("vipSlotCreated")) iVipSlotCreated = server.Data.getInt("vipSlotCreated");
    
    //create list and read list
    if (!server.Data.issetObject("vipPlayerList")) server.Data.setObject("vipPlayerList", new List<String>());
    List<String> lVipPlayerList = (List<String>)server.Data.getObject("vipPlayerList");
    
    if (server.PlayerCount < iPlayerToCopy && iVipSlotCreated == 0) {
    	// remove player
    	lVipPlayerList.Remove(player.Name);
    	if (bShowToProcon) plugin.PRoConChat("^b^1VIPSlots^0^n: Removed " + player.Name + " from temporary VIP list");
    }
    
    if (server.PlayerCount == 1) {
    	// vip slots created
    	server.Data.setInt("vipSlotCreated", 0);
    	lVipPlayerList.Clear();
    	if (bShowToProcon) plugin.PRoConChat("^b^1VIPSlots^0^n: Temporary VIP list cleared and open new chance to get vip slots");
    }
    return false;

    --------------------------------------------
    v1.0 (05-05-2017)
    - original version
    Last edited by Grovax; 06-05-2017 at 10:08.

  2. #2
    Senior Member
    Join Date
    Oct 2015
    Location
    Germany
    Posts
    219
    good idea, nice limit!

  3. #3
    Is it possible for anyone to help me?I want to block explosives from locker and metro

  4. #4
    Senior Member
    Join Date
    Nov 2011
    Location
    Germany
    Posts
    154
    Quote Originally Posted by m1o2u3s4 View Post
    Is it possible for anyone to help me?I want to block explosives from locker and metro
    ehm, wrong thread? you can ask here: https://forum.myrcon.com/showthread....imits-Requests

  5. #5
    It seems like this limit doesn't always add the VIPs. I believe it happens when the trigger number of players happens in between rounds. Something you might want to look in to.

    Other than that, it's a really great limit and I enjoy using it!

  6. #6
    Quote Originally Posted by Link4134 View Post
    It seems like this limit doesn't always add the VIPs. I believe it happens when the trigger number of players happens in between rounds. Something you might want to look in to.

    Other than that, it's a really great limit and I enjoy using it!
    Nevermind, I thought it was set to allow new VIPs when the server goes under 4 players. I can easily change this. Great limit!

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •