13.08.2018, 22:38
(
Последний раз редактировалось jlalt; 15.08.2018 в 07:02.
)
assign Cancelhit to -1 by default.
and assign it to targetid when /hit used. ex Cancelhit[playerid] = targetid;
then later
so
and assign it to targetid when /hit used. ex Cancelhit[playerid] = targetid;
then later
so
PHP код:
CMD:chit(playerid, params[])
{
new ID,string[170];
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "{189381}USAGE: {FFFFFF}/chit [ID]");
if(IsPlayerConnected(ID))
{
if(Cancelhit[ID] == playerid)
{
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[ID] = -1;
}
else if(Cancelhit[ID] == -1)
SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}You don't own any hit from this player to cancel!");
else
SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}You don't own this player's hit to cancel!");
}
return 1;
}