Originally Posted by erik019
We dont have a ping kicker.If the ping of the hole server is 200 (ping in the client) then the server crashes...Like when you exit samp-server.exe
The kick and ban commands are the same as in the GF edit I not sure but not only with these 2 commands do this the server |
if(strcmp(cmd, "/ban", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] <= 2) { SendClientMessage(playerid, COLOR_GRAD1, "You dont have permissions!"); SecondLifeInfoBox(playerid, "You cannot use this command~n~because you are not an admin."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Use: /ban [PlayerID/PartOfTheName] [reason]"); return 1; } giveplayerid = ReturnUser(tmp); if (PlayerInfo[playerid][pAdmin] >= 3) { if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "Use: /ban [PlayerID/PartOfTheName] [reason]"); return 1; } new year, month,day; getdate(year, month, day); format(string, sizeof(string), "[ADMIN]: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year); BanLog(string); AdminLog(string); format(string, sizeof(string), "[ADMIN]: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year); SendClientMessageToAll(COLOR_LIGHTRED, string); new ipaddress[16]; GetPlayerIp(giveplayerid,ipaddress,sizeof(ipaddress)); new BannedReason[126]; format(BannedReason, sizeof(BannedReason), "Banned. Reason: %s", (result)); Ban(giveplayerid); Kick(giveplayerid); return 1; } }//not connected } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1; }
if(strcmp(cmd, "/kick", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] <= 1) { SendClientMessage(playerid, COLOR_GRAD1, "You dont have permission!"); SecondLifeInfoBox(playerid, "You cant use this command~n~because you are not an admin."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Use: /kick [PlayerID/PartOfTheName] [Reason]"); return 1; } giveplayerid = ReturnUser(tmp); if (PlayerInfo[playerid][pAdmin] >= 2) { if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "Use: /kick [PlayerID/PartOfTheName] [Reason]"); return 1; } new year, month,day; getdate(year, month, day); format(string, sizeof(string), "[ADMIN]: %s has been kicked by %s, Reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year); KickLog(string); format(string, sizeof(string), "[ADMIN]: %s has been kicked by %s, Reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year); SendClientMessageToAll(COLOR_RED, string); Kick(giveplayerid); return 1; } } } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1; }
if(strcmp(cmdtext, "/ban", true,4) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] <= 2) { SendClientMessage(playerid, COLOR_GRAD1, "You dont have permissions!"); SecondLifeInfoBox(playerid, "You cannot use this command~n~because you are not an admin."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Use: /ban [PlayerID/PartOfTheName] [reason]"); return 1; } giveplayerid = strval(tmp); if (PlayerInfo[playerid][pAdmin] >= 3) { if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "Use: /ban [PlayerID/PartOfTheName] [reason]"); return 1; } new year, month,day; getdate(year, month, day); format(string, sizeof(string), "[ADMIN]: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year); BanLog(string); AdminLog(string); format(string, sizeof(string), "[ADMIN]: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year); SendClientMessageToAll(COLOR_LIGHTRED, string); new ipaddress[16]; GetPlayerIp(giveplayerid,ipaddress,sizeof(ipaddress)); new BannedReason[126]; format(BannedReason, sizeof(BannedReason), "Banned. Reason: %s", (result)); Ban(giveplayerid); Kick(giveplayerid); return 1; } }//not connected } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1; }
if(strcmp(cmdtext, "/kick", true,5) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] <= 1) { SendClientMessage(playerid, COLOR_GRAD1, "You dont have permission!"); SecondLifeInfoBox(playerid, "You cant use this command~n~because you are not an admin."); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Use: /kick [PlayerID/PartOfTheName] [Reason]"); return 1; } giveplayerid = strval(tmp); if (PlayerInfo[playerid][pAdmin] >= 2) { if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "Use: /kick [PlayerID/PartOfTheName] [Reason]"); return 1; } new year, month,day; getdate(year, month, day); format(string, sizeof(string), "[ADMIN]: %s has been kicked by %s, Reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year); KickLog(string); format(string, sizeof(string), "[ADMIN]: %s has been kicked by %s, Reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year); SendClientMessageToAll(COLOR_RED, string); Kick(giveplayerid); return 1; } } } else { format(string, sizeof(string), " %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1; }