Hallo!
Ich möchte mal fragen warum nach einem Bann/Kick die ClientMessage nicht kommt? also da ist einfach "Server Closed the Connection"
CODE:
CMD:kick(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][Helper] == 1) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /kick [playerid] [reason]"); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); CMDMessageToAdmins(playerid,"KICK"); if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 1) { if(isnull(tmp2)) { format(string,sizeof(string),"%s has been kicked by Administrator %s ",playername,adminname,params[2]); SendClientMessageToAll(red,string); format(string,sizeof(string),"[ No Reason Given ]",params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } else { format(string,sizeof(string),"%s has been kicked by Administrator %s ",playername,adminname,params[2]); SendClientMessageToAll(red,string); format(string,sizeof(string),"[ Reason: %s ]",params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } } } if(PlayerInfo[playerid][Helper] == 1) { if(isnull(tmp2)) { format(string,sizeof(string),"%s has been kicked by Help moderator %s [no reason given] ",playername,adminname); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } else { format(string,sizeof(string),"%s has been kicked by Help moderator %s [reason: %s] ",playername,adminname,params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } } } else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin"); } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands"); return 1;}
CMD:kick(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 1 || PlayerInfo[playerid][Helper] == 1) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /kick [playerid] [reason]"); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); CMDMessageToAdmins(playerid,"KICK"); if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 1) { if(isnull(tmp2)) { format(string,sizeof(string),"%s has been kicked by Administrator %s ",playername,adminname,params[2]); SendClientMessageToAll(red,string); format(string,sizeof(string),"[ No Reason Given ]",params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } else { format(string,sizeof(string),"%s has been kicked by Administrator %s ",playername,adminname,params[2]); SendClientMessageToAll(red,string); format(string,sizeof(string),"[ Reason: %s ]",params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } } } if(PlayerInfo[playerid][Helper] == 1) { if(isnull(tmp2)) { format(string,sizeof(string),"%s has been kicked by Help moderator %s [no reason given] ",playername,adminname); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } else { format(string,sizeof(string),"%s has been kicked by Help moderator %s [reason: %s] ",playername,adminname,params[2]); SendClientMessageToAll(red,string); SaveToFile("KickLog",string); print(string); return Kick(player1); } } } else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin"); } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands"); return 1;}
und ehh Time mute kann ich iwie auch nicht, erbitte hilfe!!!
CODE:
CMD:mute(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][Level] >= 2) { new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /mute [playerid] [reason]"); new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) { if(PlayerInfo[player1][Muted] == 0) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); CMDMessageToAdmins(playerid,"MUTE"); PlayerPlaySound(player1,1057,0.0,0.0,0.0); PlayerInfo[player1][Muted] = 1; PlayerInfo[player1][MuteWarnings] = 0;
if(strlen(tmp2)) { format(string,sizeof(string),"You have been muted by Administrator %s [reason: %s]",adminname,params[2]); SendClientMessage(player1,blue,string); format(string,sizeof(string),"You have muted %s [reason: %s]", playername,params[2]); return SendClientMessage(playerid,blue,string); } else { format(string,sizeof(string),"You have been muted by Administrator %s",adminname); SendClientMessage(player1,blue,string); format(string,sizeof(string),"You have muted %s", playername); return SendClientMessage(playerid,blue,string); } } else return SendClientMessage(playerid, red, "Player is already muted"); } else return SendClientMessage(playerid, red, "Player is not connected or is the highest level admin"); } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");}
MFG