Cancel hit command.
#2

assign Cancelhit to -1 by default.
and assign it to targetid when /hit used. ex Cancelhit[playerid] = targetid;
then later
so
PHP код:
CMD:chit(playeridparams[]) 

    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(stringsizeof(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(-1string); 
            
GameTextForPlayer(ID"~n~~n~~Y~HIT ~G~CANCELLED"65005); 
            
GameTextForPlayer(playerid"~n~~n~~P~You ~R~Cancelled ~G~the ~Y~HIT"70005); 
            
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

Reply


Messages In This Thread
Cancel hit command. - by Thanks - 13.08.2018, 21:18
Re: Cancel hit command. - by jlalt - 13.08.2018, 22:38

Forum Jump:


Users browsing this thread: 1 Guest(s)