28.11.2012, 12:16
Here you go added that thingy in your code.
pawn Код:
if(strcmp(cmd, "/kick", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
new sat, minuta, sekunda;
new giveip[128], senderip[128];
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTENJE: /kick [Playerid/DioImena] [razlog]");
return 1;
}
if (PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pGameMaster] < 1) return NisiOvlasten(playerid);
{
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(PlayerInfo[playerid][pAdminLogin] != 1) return NisiPrijavljen(playerid);
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTENJE: /kick [Playerid/DioImena] [razlog]");
return 1;
}
new year, month,day/*,/reason[64]*/;
getdate(year, month, day);
GetPlayerIp(playerid,senderip,sizeof(senderip));
GetPlayerIp(giveplayerid,giveip,sizeof(giveip));
gettime(sat, minuta, sekunda);
if(PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "AdmCmd: %s[%d] je dobio kick od Admina %s[%d], razlog: %s | %d.%d.%d | %d:%d:%d |", giveplayer, giveip, sendername, senderip, (result),month,day,year, sat, minuta, sekunda);
KickLog(string);
format(string, sizeof(string), "AdmCmd: %s je dobio kick od Admina %s, razlog: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(giveplayerid);
return 1;
}
else
{
format(string, sizeof(string), "AdmCmd: %s je dobio kick od GameMastera %s, razlog: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
KickLog(string);
format(string, sizeof(string), "AdmCmd: %s je dobio kick od GameMastera %s, razlog: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(giveplayerid);
return 1;
}
}
}
else return SendClientMessage(playerid,COLOR_GRAD2, "That player is not offline therefore you can not kick them!");
}
}
return 1;
}