Message not displaying to player
#1

When I kick someone from the server, He will get kicked but he can't see the reason why he got kicked. Here's the kick command [not whole command].

pawn Код:
format(string, sizeof(string), ""chat""COLOR_RED" %s %s kicked your from the server [Reason: %s]",GetAdminName(playerid),PlayerName(playerid),reason);
        SendClientMessage(targetid,-1,string);

        Kick(targetid);
    }
    else {
        SendClientMessage(playerid,-1,""chat""COLOR_BLUE" You don't have admin permission for this");
    }
    return 1;
}
What's wrong? Do you need whole command?
Reply
#2

pawn Код:
forward KickPublic(playerid);
public KickPublic(playerid) { Kick(playerid); }
 
stock KickWithMessage(playerid, color, message[])
{
    SendClientMessage(playerid, color, message);
    SetTimerEx("KickPublic", 1000, 0, "d", playerid);   //Delay of 1 second before kicking the player so he recieves the message
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/kickme", true) == 0)
    {
        //Kicks the player who the executed this command
        KickWithMessage(playerid, 0xFF0000FF, "You have been kicked.");
        return 1;
    }
    return 0;
}
Reply
#3

https://sampwiki.blast.hk/wiki/Kick

This will really help you.

Read it fully.
Reply
#4

Quote:
Originally Posted by SilverKiller
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/Kick

This will really help you.

Read it fully.
I didn't noticed that last part, I will read it now.
Cheers!

@Avi- Thank you too.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)