31.03.2015, 11:23
PHP код:
#include <a_samp>
#include <zcmd> // need this
#include <sscanf> // need this
CMD:kick(playerid,params[])
{
new targetid,name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME],msg[128],msg2[128],msg3[128];
{
if(sscanf(params,"u",targetid)) return SendCLientMessage(playerid,-1,"syntax: /kick [ID/name]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not admin");
if(IsPlayerAdmin(ID)) return SendClientMessage(playerid,-1,"You cannot kick other administrators");
else if(targetid == playerid) return SendClientMessage(playerid,-1,"You cannot kick yourself");
else
{
GetPlayerName(ID,name,sizeof(name)); // We take targetid's name
format(msg,sizeof(poruka),"You kicked %s from the server",name); // formating messages which will be sent to you
SendClientMessage(playerid,-1,poruka); // sent
GetPlayerName(playerid,name2,sizeof(name2)); //we take your name
format(msg2,sizeof(poruka2),"%s just kicked you from the server",name); // we send message to target
SendClientMessage(ID,-1,poruka2); // sent
format(msg3,sizeof(msg3),"%s kicked %s from the server",name2,name); // formating message to send for all
SendClientMessageToAll(-1,msg3); // sent
{
Kick(ID);
}
}
return 1;
}
}