24.04.2012, 22:51
(
Last edited by sscarface; 24/04/2012 at 11:23 PM.
)
i have /hit or /hitlist command but i want add /cancelhit command example if u /hit any player and u want i cancelhit so i need /cancelhit command and u can /cancelhit in 60 sec after u can't cancelhit
and this is my gm hit line:
and
can u give me /cancelhit command code and sorry my english is poor but i hope u understand
and this is my gm hit line:
Code:
if(!strcmp(cmdtext, "/hitlist", true)) { new count = 0; SendClientMessage(playerid, COLOR_MSG, "Listing currently placed hits:"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && hit[i] > 0) { new string[256]; format(string, 256, "Hit on %s (%i) for $%i", ReturnPlayerName(i), i, hit[i]); SendClientMessage(playerid, COLOR_FOUND, string); count++; } } if(count == 0) { SendClientMessage(playerid, COLOR_ERROR, "No hits placed at this time!"); } }
Code:
dcmd_hit(playerid, params[]) { new amount, ID; if(sscanf(params, "dd", ID, amount)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /hit [ID] [amount]"); } else if(amount > 0) { if(IsPlayerConnected(ID)) { if(gTeam[playerid] != COP && gTeam[playerid] != SWAT && gTeam[playerid] != FBI && gTeam[playerid] != ARMY) { if(GetPlayerMoney(playerid) >= amount) { if(antispam[playerid] == 0) { hit[ID] = amount; hiter[ID] = playerid; new string[256]; format(string, sizeof(string), "You have placed a hit on %s (%i) for $%i", ReturnPlayerName(ID), ID, amount); SendClientMessage(playerid, COLOR_MSG, string); format(string, sizeof(string), "%s (%i) has placed a hit on %s (%i) for $%i", ReturnPlayerName(playerid), playerid, ReturnPlayerName(ID), ID, amount); SendClientMessageToAll(COLOR_MSG, string); antispam[playerid] = 1; SetTimerEx("antispamtimer", ANTISPAM_TIME*1000, false, "d", playerid); } else { SendClientMessage(playerid, COLOR_ERROR, "Please wait before placing another hit!"); } } else { SendClientMessage(playerid, COLOR_ERROR, "You do not have enough money!"); } } else { SendClientMessage(playerid, COLOR_ERROR, "You team cannot hit an player!"); } } else { SendClientMessage(playerid, COLOR_ERROR, "That player is not connected!"); } } else { SendClientMessage(playerid, COLOR_ERROR, "Minimum amount to hit a person with is $1!"); } return 1; }