26.09.2009, 18:54
Havent tested this or checked if it worked. But i think its something close to like that
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(bite,4,cmdtext); return 0; } dcmd_bite(playerid,params[]) { new tmp[4],idx; tmp = strtok(params,idx); if(!strval(tmp)) { SendClientMessage(playerid,COLOUR_RED,"USAGE: /bite [ID]"); return 1; } else { new pid,string[34],string1[30]; pid = strval(tmp); SetPlayerHealth(pid,GetPlayerHealth(pid)-25); format(string),sizeof(string),"You have succesfully bitten %s",pid); format(string1),sizeof(string1),"You have been bitten by %s",playerid); SendClientMessage(playerid,COLOUR_YELLOW,string); SendClientMessage(pid,COLOUR_RED,string1); return 1; } return 1; }