24.08.2009, 14:09
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;
}
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;
}

