Needing a /kick [id] [reason] Command?
#6

here is mine..:

if(strcmp(cmd, "/Kick", true) == 0) // KICK
{
if(PlayerInfo[playerid][Admin] < 3) return DenyMessage(playerid, 3);
tmp = strtok(cmdtext, idx);
new otherplayer = strval(tmp);
if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, WHITEBLUE, "Invalid Player ID.");
new file[256];

new name[MAX_PLAYER_NAME], opname[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid, name, sizeof name);
GetPlayerName(otherplayer, opname, sizeof opname);

if(PlayerInfo[playerid][Admin] < PlayerInfo[otherplayer][Admin]) return SCM(playerid, RED, ".аъд ма йлем мдщъощ бфчегд же тм шод йеъш вебдд ощмк");
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(tmp)) return SCM(playerid, WHITE, "/Kick [playerid] [Reason]");
if(!strlen(result))
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
format(string,sizeof(string),".[%s :сйбд] [ID: %d | %s] дтйу аъ дщзчп %s дагойп", name, otherplayer, opname, name);
SCM(i, RED, string);
}
}
else
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
format(string,sizeof(string),".[%s :сйбд] [ID: %d | %s] дтйу аъ дщзчп %s дагойп", result, otherplayer, opname, name);
SCM(i, RED, string);
}
}
Kick(otherplayer);
new year, month, day;
getdate(year,month,day);
format(file, sizeof(file), "DAR/Users/Kicks/%s.txt", opname);
if(dini_Exists(file))
{
dini_Set(file, "AdminName", name);
dini_Set(file, "KickedName", opname);
dini_Set(file, "reason", result);
dini_IntSet(file, "day", day);
dini_IntSet(file, "month", month);
dini_IntSet(file, "year", year);
}
else
{
dini_Create(file);
dini_Set(file, "AdminName", name);
dini_Set(file, "KickedName", opname);
dini_Set(file, "reason", result);
dini_IntSet(file, "day", day);
dini_IntSet(file, "month", month);
dini_IntSet(file, "year", year);
}
DisconnectReason[otherplayer] = 1;
return 1;
}
Reply


Messages In This Thread
Needing a /kick [id] [reason] Command? - by Kyle - 24.08.2009, 10:04
Re: Needing a /kick [id] [reason] Command? - by krisko - 24.08.2009, 10:14
Re: Needing a /kick [id] [reason] Command? - by Ironboy500 - 24.08.2009, 10:15
Re: Needing a /kick [id] [reason] Command? - by Weirdosport - 24.08.2009, 11:08
Re: Needing a /kick [id] [reason] Command? - by Kyle - 24.08.2009, 13:53
Re: Needing a /kick [id] [reason] Command? - by borisblat - 24.08.2009, 14:09
Re: Needing a /kick [id] [reason] Command? - by Kyle - 25.08.2009, 11:37
Re: Needing a /kick [id] [reason] Command? - by Correlli - 25.08.2009, 11:39
Re: Needing a /kick [id] [reason] Command? - by [LSB]Clinz - 25.08.2009, 11:40
Re: Needing a /kick [id] [reason] Command? - by Kyle - 25.08.2009, 12:02

Forum Jump:


Users browsing this thread: 1 Guest(s)