08.07.2009, 14:10
Quote:
Originally Posted by Frankox
K, is there any other way besides dcmd?
|
pawn Код:
// On top:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
// OnPlayerCommandText:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(adminkill,9,cmdtext);
return 0;
}
dcmd_adminkill(playerid, params[])
{
new otherid = strval(params);
if(IsPlayerAdmin(playerid))
{
if (sscanf(params, "d", otherid))
return SendClientMessage(playerid, 0xFFFFFF, "/adminkill playerid");
if(!IsPlayerConnected(otherid))
return SendClientMessage(playerid, 0xFFFFFF, "That player is not connected!");
SetPlayerHealth(otherid, 0);
}
return 1;
}