02.03.2014, 10:31
I have this codes:
The thing is, the player that is kicked can't see the message indicating that he is kicked:
Any help?
pawn Код:
dcmd_kick(playerid,params[])
{
if(PInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
{
//Variables and stuff
new id, pName[MAX_PLAYER_NAME], pAdminName[MAX_PLAYER_NAME];
new tmp[256], Index, str[512];
tmp = strtok(params,Index), id = strval(tmp);
GetPlayerName(playerid, pAdminName, sizeof(pAdminName));
GetPlayerName(id,pName, sizeof(pName));
//Checking
if(!strlen(params)) return SendClientMessage(playerid, -1, ""COL_ORANGE"Usage: "COL_GREY"/kick <id>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, INCORRECT_ID);
//Main code
format(str,sizeof(str),""MESSAGE_TAG" "COL_GREY"Admin "COL_LBLUE"%s "COL_GREY"has kicked "COL_RED"%s", pAdminName, pName);
SendClientMessageToAll(-1,str);
new str2[512];
format(str2, sizeof(str2), ""MESSAGE_TAG" "COL_GREY"You have been "COL_RED"kicked "COL_GREY"by admin "COL_LBLUE"%s", pAdminName);
SendClientMessage(id, -1, str2);
Kick(id);
return 1;
}
else
{
SendClientMessage(playerid, -1, NOT_ALLOWED);
return 1;
}
}
pawn Код:
new str2[512];
format(str2, sizeof(str2), ""MESSAGE_TAG" "COL_GREY"You have been "COL_RED"kicked "COL_GREY"by admin "COL_LBLUE"%s", pAdminName);
SendClientMessage(id, -1, str2);