Kick won't work
#1

Код:
 	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
    {
        CrouchCount[playerid] ++;
        if(CrouchCount[playerid] > 5) return SendClientMessage(playerid,-1,COL_RED"[WS:AC] "COL_WHITE"Izbaceni ste zbog iskoristavanja "#COL_ORANGE"C-Bug"#COL_WHITE"-a");
		Kick(playerid);
    }
here on ONE press on button 'C' write: "Server closed connection" and without there ClientMessage!

on ban similar problem, won't kick player right now and won't send ClientMessages ...


Код:
SetTimer("ResetCrouchCount", 5000, true);
Reply
#2

lol, you have return SendClientMessage, that's why it doesn't kick that player, when you "return" something that is part where code stop executing...
Reply
#3

Try this..
Код:
 	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
    {
        CrouchCount[playerid] ++;
        if(CrouchCount[playerid] > 5) 
        {
        SendClientMessage(playerid,-1,COL_RED"[WS:AC] "COL_WHITE"Izbaceni ste zbog iskoristavanja "#COL_ORANGE"C-Bug"#COL_WHITE"-a");
	Kick(playerid);
        }
        return 1;
    }
Reply
#4

pawn Код:
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
{
    CrouchCount[playerid] ++;
    if(CrouchCount[playerid] > 5)
    {
        SendClientMessage(playerid,-1,""#COL_RED"[WS:AC] "#COL_WHITE"Izbaceni ste zbog iskoristavanja "#COL_ORANGE"C-Bug"#COL_WHITE"-a");
        return Kick(playerid);
    }
}
??
Reply
#5

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
pawn Код:
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
{
    CrouchCount[playerid] ++;
    if(CrouchCount[playerid] > 5)
    {
        SendClientMessage(playerid,-1,""#COL_RED"[WS:AC] "#COL_WHITE"Izbaceni ste zbog iskoristavanja "#COL_ORANGE"C-Bug"#COL_WHITE"-a");
        return Kick(playerid);
    }
}
??
You forgot the return 1; at the end.


pawn Код:
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
{
    CrouchCount[playerid] ++;
    if(CrouchCount[playerid] > 5)
    {
        SendClientMessage(playerid,-1,""#COL_RED"[WS:AC] "#COL_WHITE"Izbaceni ste zbog iskoristavanja "#COL_ORANGE"C-Bug"#COL_WHITE"-a");
        return Kick(playerid);
    }
return 1;
}
Reply
#6

It's not completely necessary to always return 1 at the end of a code, most likely in the event of a command etc... but seeing as there is no real value to be returned, seeing as it isn't a stock function, but it is a timer and doesn't really need to return a value, the code was fine how it was.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)