25.01.2010, 04:57
Hey,
I got this function which suddenly stopped working:
Player get's all messages ("You have been kicked...") but it doesn't get's kicked... I have to kick them manually using /kick command (it works perfectly), which uses the same Kick(id);
I got this function which suddenly stopped working:
pawn Код:
//OnPlayerConnect
if(CheckPlayerName(plName)==0)
{
ErrorMsg(playerid,"Didn't you noticed that this is a ROLEPLAY server??");
KickPlayer(playerid,"Non-RP name!","Your name must be in FirstName_LastName format!");
}
stock KickPlayer(playerid,reason1[128],reason2[256],kickerid=-255)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid,COLOR_ERROR,"____________________________________________________________");
if(kickerid != -255)
{
SendFMessageToAll(COLOR_ERROR,"%s has been kicked by %s",pName[playerid],pName[kickerid]);
}
else
{
SendFMessageToAll(COLOR_ERROR,"%s has been kicked!",pName[playerid]);
}
new str[512];
format(str,512,"Reason: %s",reason1);
SendClientMessageToAllEx(playerid,COLOR_ERROR,str);
SendFMessage(playerid,COLOR_ERROR,"Reason: %s",reason2);
SendClientMessage(playerid,COLOR_ERROR,"____________________________________________________________");
Kick(playerid); // THIS SHOULD KICK THE PLAYER
}
}