12.08.2011, 15:13
(
Последний раз редактировалось swieberdevos; 12.08.2011 в 16:07.
)
I saw in a server that they can reconnect players..
How to reconnect a player?
How to reconnect a player?
OnPlayerConnect(playerid) { new IP[20]; GetPlayerIp(playerid,IP,sizeof(IP)); SetPVarString(playerid,"ip",IP); } OnPlayerBugged(playerid) { SetPVarInt(playerid,"bugban",1); new IP[24]; GetPlayerIp(playerid,IP,sizeof(IP)); format(IP,sizeof(IP),"banip %s",IP); SendRconCommand(IP); } OnPlayerDisconnect(playerid) { if(GetPVarInt(playerid,"bugban") == 1) { new string[24]; GetPVarString(playerid,"ip",string,sizeof(string)); format(string,sizeof(string),"unbanip %s",string); SendRconCommand(string); SendRconCommand("reloadbans"); } }
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1) {
new PID;
if(sscanf(params, "u", PID)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid] [reason]");
if(!IsPlayerConnected(PID))
return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
Kick(PID);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not an administrator, so you can't use this command!");
}
return 1;
}