25.11.2014, 21:00
Hello, so I've made a ban command and with the ban it just bans and shows a message to the players, but not the banned player, for the banned player it shows Server closed connection, i wanted it to show why he has been banned.
I've also got the same problem onplayerconnect where if it reads the ban it just kicks the player not gives him a message.
Code:
and
If you can help me that would be great! thank you
I've also got the same problem onplayerconnect where if it reads the ban it just kicks the player not gives him a message.
Code:
Код:
ACMD:ban(playerid, params[]) { if (pInfo[playerid][Adminlevel] < 2)return 0; new reason[128], string[250]; if(sscanf(params, "us[128]",ID, reason)) return SCM(playerid, orange, "--- /ban <ID> <Reason> ---"); if(ID == IPI)return SCM(playerid, red, "Player is not connected!"); pInfo[ID][Banned]=1; GetPlayerName(ID,pname,MAX_PLAYER_NAME); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); SetTimerEx("KickTimer", 10, false, "i", playerid); format(string, sizeof(string), "%s %s has banned %s for %s", AdminLevelName(playerid),Nam, pname, reason); SCMToAll(red, string); Kick(ID); return 1; }
Код:
public OnPlayerConnect(playerid) { if(pInfo[playerid][Banned]==1) { SCM(playerid, red, "You are banned from the server"); SetTimerEx("DelayedKick", 1000, false, "d", playerid); Kick(playerid); }