13.08.2018, 21:18
Hello friends! I've created a command for cancel hit! but there are no problems but How To I can add If someone /hit someone and other player wanna type eg: /chit 1 but he is not own the hit they must send him a message example:
You don't own this hit to cancel the hit.
You don't own this hit to cancel the hit.
PHP код:
CMD:chit(playerid, params[])
{
new ID,string[170];
if(sscanf(params, "uds[50]", ID)) return SendClientMessage(playerid, -1, "{189381}USAGE: {FFFFFF}/chit [ID]");
if(IsPlayerConnected(ID))
{
if(Cancelhit[playerid] == 1)
{
format(string, sizeof(string), "{68FF00}[Hit Cancelled]: {FFFFFF}Player {0080FF}%s(%d) {FFFFFF}has {E33667}Cancelled {FFFFFF}the hit on {FFD700}%s(%d){FFFFFF}.",ReturnPlayerName(playerid), playerid,ReturnPlayerName(ID), ID);
SendClientMessageToAll(-1, string);
GameTextForPlayer(ID, "~n~~n~~Y~HIT ~G~CANCELLED", 6500, 5);
GameTextForPlayer(playerid, "~n~~n~~P~You ~R~Cancelled ~G~the ~Y~HIT", 7000, 5);
hit[playerid] = 0;
Cancelhit[playerid] = 0;
}
else
SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}That player is not connected OR None hit this player.");
}
return 1;
}