PDA

View Full Version : Help with kick command


Tadas
16/04/2014, 05:14 PM
Hello, I have problem with kick command. When I tipe /kick it kick the player but don't send him a message.

There is the code:
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] == 1)
{
new PID;
new reason[64];
new str[127];
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
GetPlayerName(playerid, Adminname, sizeof(Adminname));
GetPlayerName(PID, Playername, sizeof(Playername));
if(sscanf(params, "us", PID,reason)) return SendClientMessage(playerid, ZALIA, "Naudojimas: /kick [Vardas] [Priezastis]");
if(!IsPlayerConnected(PID))
return SendClientMessage(playerid, RAUDONA, "Žaidėjas neprisijunges!");
format(str, sizeof(str), "[KICK] %s išmetė %s už [%s] ", Playername, Adminname, reason);
kickzinute[playerid] = SendClientMessageToAll(GELTONA, str);
SetTimer("kickzinutestimeris", 10, false);
Kick(PID);
}
else
{
SendClientMessage(playerid, RAUDONA, "Šia komanda gali naudotis tik Administratoriai");
}
return 1;
}

And other:
forward kickzinutestimeris(playerid);
public kickzinutestimeris(playerid)
{
SendClientMessageToAll(GELTONA, kickzinute[playerid]);
}

LocMax
16/04/2014, 05:20 PM
stock KickEx(playerid) return SetTimerEx("KickPublic", 1000, 0, "d", playerid);

forward KickPublic(playerid);
public KickPublic(playerid) Kick(playerid);

And use KickEx(playerid) instead of Kick(playerid)

Tadas
16/04/2014, 05:36 PM
stock KickEx(playerid) return SetTimerEx("KickPublic", 1000, 0, "d", playerid);

forward KickPublic(playerid);
public KickPublic(playerid) Kick(playerid);

And use KickEx(playerid) instead of Kick(playerid)

Thanks :) +Rep