Results 1 to 7 of 7

Thread: Message box wont pop up

  1. #1
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts

    Message box wont pop up

    Hi all,
    I made a kick function and when u are kicked a message box should pop up.
    Code:
           
            self setClientCvar("com_errorTitle", "KICKED");
    	self setClientCvar("com_errorMessage", "You are kicked by: " +admin +"\n" + "^7Reason: "+reden);
    	wait 1;
     	self setClientCvar ("clientcmd", "disconnect");
    I disconnect but no message. There is also no error in the code

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Try using the kick2("reason") in libcod
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. #3
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Hoe does that one work?

  4. #4
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    It's not working because you are disconnecting the player, which does not trigger the "You have been kicked." dialogue. Try doing a normal kick.

  5. #5
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by IzNoGoD View Post
    Try using the kick2("reason") in libcod
    PHP Code:
    kick2(clientnum"message"); 
    It currently doesn't temporally ban the player for a few minutes like the default function does (uses tempBanClient).
    Your message starts with the player's name and then you message. I don't know if there is a way around this.

    Edit: it sends the disconnect message like this (A):
    PHP Code:
    SV_SendServerCommand(client1"%c \"%s\""119message); 
    or B:
    PHP Code:
    SV_SendServerCommand(client1"%c \"%s^7 %s\" PB"119, &playernamemessage); 
    I think A is for precached messages and B isn't.

    Edit 2: in the function tempBanClient after "%s (guid %i) was kicked for cheating\n" is the function that bans the guid.

    PHP Code:
    SV_BanGuidBriefly(int guid) = 808D72E (1.3
    Last edited by Mitch; 25th June 2015 at 13:18.

  6. #6
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    If I use kick(id) its not working
    Code:
    	kick2(id, "You are kicked by: " +admin +"\n" + "^7Reason: "+reden +"");
    Is not doing anything( doesnt throw me out of the server)
    Error:
    Code:
    Param 0 needs to be an int, >make function for this<=0 given! NumParams=2
    Param 1 needs to be a string, >make function for this<=0 given! NumParams=2
    scriptengine> ERROR: gsc_kick_slot(): param "id"[1] has to be an int!
    scriptengine> ERROR: gsc_kick_slot(): param "msg"[2] has to be an string!
    I already made a ban function
    Code:
    				if(thisPlayerNum == banipNum && isAlive(players[i]) ) 
    				{
    					ip= players[i] getIP();
    					players[i] writebanlist(ip);
                                            players[i] setClientCvar("com_errorTitle", "BANNED");
    					players[i] setClientCvar("com_errorMessage", "You are permanently banned from this server!\nIf you think it is an unfair ban,\ngo to www^1.^7evilmulticlan^1.^7tk and complain about it.");
       					players[i] setClientCvar ("clientcmd", "disconnect");
       					players[i] openMenu ("clientcmd");
       					players[i] closeMenu ("clientcmd");
    					iprintln(players[i].name + "^7 was Banned by the ^7Admin");
    				}
    And with this function I do see message box

    EDIT:
    Stupid error. Should be admin.NAME
    Last edited by Ni3ls; 26th June 2015 at 11:30.

  7. #7
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Try using a more recent version of libcod to get kick2 working
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

Posting Permissions

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