Kick won't work - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Kick won't work (
/showthread.php?tid=406336)
Kick won't work -
FL3GM4 - 10.01.2013
Код:
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);
Re: Kick won't work -
CoaPsyFactor - 10.01.2013
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...
Re: Kick won't work -
blackbhuta - 10.01.2013
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;
}
Re: Kick won't work -
Threshold - 10.01.2013
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);
}
}
??
Re: Kick won't work -
denNorske - 10.01.2013
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;
}
Re: Kick won't work -
Threshold - 10.01.2013
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.