02.03.2010, 18:31
hello, im looking for a Ban Command and a Kick Command, but, you only can BAN with the name i need.. you understand?
i mean, only my name can BAN/KICK.. i dont have IDea :S
i mean, only my name can BAN/KICK.. i dont have IDea :S
Код:
if(strcmp(cmd, "/Ban", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Utiliza: /Ban [ID/Nombre] [Razon]"); return 1; } giveplayerid = ReturnUser(tmp); if(PlayerInfo[giveplayerid][pAdmin] > 1337) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "AdmCmdPro: Nothing xD", sendername); SendClientMessageToAll(COLOR_LIGHTRED, string); Ban(playerid); return 1; } if (PlayerInfo[playerid][pAdmin] >= 1) { 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, "Utiliza: /Ban [ID/Nombre] [Razon]"); return 1; } new year, month,day; getdate(year, month, day); format(string, sizeof(string), "AdmCmd: %s Fue Baneado Por: %s, Razуn: %s ", giveplayer, sendername, (result)); BanLog(string); format(string, sizeof(string), "AdmCmd: %s Fue Baneado Por: %s, Razуn: %s", giveplayer, sendername, (result)); SendClientMessageToAll(COLOR_LIGHTRED, string); PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel]; PlayerInfo[giveplayerid][pLevel] = -999; Ban(giveplayerid); return 1; } }//not connected } else { format(string, sizeof(string), " %d No es Un Jugador Activo.", giveplayerid); SendClientMessage(playerid, COLOR_GRAD1, string); } } return 1; }