#4

Use this but now you must be logen as RCON ADMIN

pawn Код:
if(strcmp(cmd, "/kick", true) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000, "* Only Admins can use this comamnd!");
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [motiv]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGm] >= 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, "USAGE: /kick [playerid/PartOfName] [motiv]");
return 1;
}
if(giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_RED,"AdmCmd: Nu iti poti da kick singur.");
return 1;
}
new year, month,day;
getdate(year, month, day);
new Hour, Min, Sec;
gettime(Hour, Min, Sec);
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* Are functie mai mare decat tine !");
format(string, sizeof(string), "AdmCmd: %s a primit kick de la %s, Motiv: %s!",giveplayer, sendername,(result));
SendClientMessageToAll(COLOR_RED, string);
format(string, sizeof(string), "AdmCmd: %s a primit kick pe data de : | %d/%d/%d | ora | %02d:%02d:%02d | ",giveplayer,day,month,year,Hour, Min, Sec);
SendClientMessageToAll(COLOR_RED, string);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) AdmCmd: %s a primit kick de la %s, Motiv: %s!",d,m,y,h,mi,s,giveplayer, sendername,(result));
KickLog(string);
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Reply


Messages In This Thread
Kick - by Akcent_Voltaj - 16.04.2013, 13:21
Re: Kick - by [MG]Dimi - 16.04.2013, 13:22
Re: Kick - by Akcent_Voltaj - 16.04.2013, 13:29
Re: Kick - by kalanerik99 - 16.04.2013, 14:08
Re: Kick - by Akcent_Voltaj - 16.04.2013, 15:31
Re: Kick - by XStormiest - 16.04.2013, 15:53
Re: Kick - by Akcent_Voltaj - 16.04.2013, 16:06
Re: Kick - by XStormiest - 16.04.2013, 16:08

Forum Jump:


Users browsing this thread: 2 Guest(s)