CMD:carplantbomb(playerid, params[]) { if(AntiSK[playerid]) return SendClientMessage(playerid, COLOR_RED, "ERROR: "COL_GREY"You're spawn protected."); if(CBomb[playerid] == 1) { new Float: X, Float: Y, Float: Z; new vehicleid = GetPlayerVehicleID(playerid); GetVehiclePos(vehicleid, X, Y, Z); SendClientMessage(playerid, 0xFFFFFFFF, "You planted bomb! Get out of there!"); CArmed[playerid] = 1; CBomb[playerid] = 0; } return 1; } CMD:plantbomb(playerid, params[]) { if(AntiSK[playerid]) return SendClientMessage(playerid, COLOR_RED, "ERROR: "COL_GREY"You're spawn protected."); if(TB[playerid] == 1)//TB { ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 0, 0, 0, 0, 1000, 1); new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); BombO = CreateObject(1252, X, Y, Z, 0.0, 0.0, 96.0); TArmed[playerid] = 1; TB[playerid] = 0; } else return SendClientMessage(playerid, COLOR_RED, "ERROR: "COL_GREY"Dont have any Bomb in-hand buy from shop."); return 1; }
new pState = GetPlayerState(playerid); if (pState == PLAYER_STATE_DRIVER) { if (newkeys & KEY_UP) { if(CArmed[playerid] == 1) { if (IsPlayerInAnyVehicle(playerid)) { new Float:X, Float:Y, Float:Z; new kills; new str[150], string[150]; new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); new vehicleid = GetPlayerVehicleID(playerid); GetVehiclePos(vehicleid, X, Y, Z); CreateExplosion(X, Y, Z, 12, 15.0); CreateExplosion(X, Y, Z, 10, 15.0); foreach(new i : Player) { if(IsPlayerInRangeOfPoint(i, 5.0, X, Y, Z) && pTeam{i} != pTeam{playerid}) { SetPlayerHealth(i, 0.0); kills += 1; } } CArmed[playerid] = 0; GivePlayerScore(playerid, kills); pInfo[playerid][Kills] += kills; format(str, sizeof str, "*Your Bomb Exploded and killed %i enemies.", kills); SendClientMessage(playerid, COLOR_GREEN, str); format(string, sizeof string, "%s's Bomb Exploded and killed %i enemies.", Name, kills); SendClientMessageToAll(COLOR_GREEN, string); } } } } if (newkeys & KEY_FIRE) //Trigger Bomb { if(TArmed[playerid] == 1) { new Float:X, Float:Y, Float:Z; new kills; new str[150], string[150]; new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); GetObjectPos(BombO, X, Y, Z); CreateExplosion(X, Y, Z, 2, 100.0); CreateExplosion(X, Y, Z, 12, 25.0); CreateExplosion(X, Y, Z, 10, 30.0); foreach(new i : Player) { if(IsPlayerInRangeOfPoint(i, 5.0, X, Y, Z) && pTeam{i} != pTeam{playerid}) { SetPlayerHealth(i, 0.0); kills += 1; } } DestroyObject(BombO); TArmed[playerid] = 0; GivePlayerScore(playerid, kills); pInfo[playerid][Kills] += kills; format(str, sizeof(str), "*Your Bomb Exploded and killed %i enemies.", kills); SendClientMessage(playerid, COLOR_GREEN, str); format(string, sizeof(string), "%s 's Bomb Exploded and killed %i enemies.", Name, kills); SendClientMessageToAll(COLOR_GREEN, string); } }
new pState = GetPlayerState(playerid); if (pState == PLAYER_STATE_DRIVER) { if (newkeys & KEY_UP) { if(CArmed[playerid] == 1) {
new vehicleid = GetPlayerVehicleID(playerid); GetVehiclePos(vehicleid, X, Y, Z);
GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
CMD:testbomb(playerid) { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); BombO = CreateObject(1252, X, Y, Z+4, 0.0, 0.0, 96.0); return 1; }
pTeam{playerid}
GetObjectPos(BombO, X, Y, Z); CreateExplosion(X, Y, Z, 2, 100.0); |
CMDlantbomb(playerid, params[]) { if(TB[playerid] == 1)//TB { ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 0, 0, 0, 0, 1000, 1); new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); BombO = CreateObject(1252, X, Y, Z, 88.0000, 91.0000, -84.0000); TArmed[playerid] = 1; TB[playerid] = 0; } else return SendClientMessage(playerid, COLOR_RED, "ERROR: "COL_GREY"Dont have any Bomb in-hand buy from shop."); return 1; } |
if (newkeys & KEY_FIRE) { if(TArmed[playerid] == 1) { new Float:X, Float:Y, Float:Z; new kills; new str[150], string[150]; new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name)); GetObjectPos(BombO, X, Y, Z); CreateExplosion(X, Y, Z, 7, 100.0); foreach(new i : Player) { if(IsPlayerInRangeOfPoint(i, 5.0, X, Y, Z) && pTeam{i} != pTeam{playerid}) { SetPlayerHealth(i, 0.0); kills += 1; } } DestroyObject(BombO); TArmed[playerid] = 0; GivePlayerScore(playerid, kills); pInfo[playerid][Kills] += kills; format(str, sizeof(str), "*Your Bomb Exploded and killed %i enemies.", kills); SendClientMessage(playerid, COLOR_GREEN, str); format(string, sizeof(string), "%s 's Bomb Exploded and killed %i enemies.", Name, kills); SendClientMessageToAll(COLOR_GREEN, string); } } |