02.05.2014, 00:33
Код:
if(VehicleBomb[vehicle] == 1) { new Float:boomx, Float:boomy, Float:boomz; GetPlayerPos(playerid,boomx, boomy, boomz); CreateExplosion(boomx, boomy , boomz, 7, 1); VehicleBomb[vehicle] = 0; }
Код:
CMD:pcb(playerid, params[]) { if(PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pLeader] == 4) { if(PlayerInfo[playerid][pC4] == 0) { if(PlayerInfo[playerid][pBombs] != 0) { new carid = GetPlayerVehicleID(playerid); new closestcar = GetClosestCar(playerid, carid); if(IsPlayerInRangeOfVehicle(playerid, closestcar, 4.0)) { if(VehicleBomb{closestcar} == 1) { SendClientMessage(playerid, COLOR_GRAD2, "There is already a C4 on the vehicle engine!"); return 1; } VehicleBomb{closestcar} = 1; PlacedVehicleBomb[playerid] = closestcar; ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0); ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0); SendClientMessage(playerid, COLOR_GREEN, "You have placed C4 on the vehicle engine, /pickupbomb to remove it."); PlayerInfo[playerid][pC4] = 1; PlayerInfo[playerid][pBombs]--; PlayerInfo[playerid][pC4Used] = 2; } else { SendClientMessage(playerid, COLOR_GRAD2, "You're not close enough to any vehicle!"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, "You do not have C4!"); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, " You can only deploy 1 C4 at a time ! "); return 1; } } else { SendClientMessage(playerid, COLOR_GRAD2, "You're not a member of the Hitman Agency ! "); } return 1; }
Код:
else if(strcmp(params, "engine", true) == 0 && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { /*if (vdisabled[GetPlayerVehicleID(playerid)]) { SendClientMessage(playerid, COLOR_RED, "The car's engine is too damaged to start!- Call a mechanic! /service mechanic"); return 1; }*/ new vehicle = GetPlayerVehicleID(playerid); new string[126]; new engine, lights, alarm, doors, bonnet, boot, objective; GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective); if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(Engine[vehicle] == 0) { if(VehicleBomb[vehicle] == 1) { new Float:boomx, Float:boomy, Float:boomz; GetPlayerPos(playerid,boomx, boomy, boomz); CreateExplosion(boomx, boomy , boomz, 7, 1); VehicleBomb[vehicle] = 0; } if(GetChased[playerid] < 999 && VehicleBomb[vehicle] == 1) { if(PlayerInfo[playerid][pHeadValue] >= 1) { if(PlayerInfo[GetChased[playerid]][pFaction] == 4 || PlayerInfo[GetChased[playerid]][pLeader] == 4) { new Float:boomx, Float:boomy, Float:boomz; GetPlayerPos(playerid,boomx, boomy, boomz); CreateExplosion(boomx, boomy , boomz, 7, 1); VehicleBomb[vehicle] = 0; PlacedVehicleBomb[GetChased[playerid]] = INVALID_VEHICLE_ID; new takemoney = PlayerInfo[playerid][pHeadValue] / 4 * 2; GivePlayerCash(GetChased[playerid], takemoney); GivePlayerCash(playerid, -takemoney); format(string,sizeof(string),"Hitman %s has fulfilled the contract on %s and collected $%d.",GetPlayerNameEx(GetChased[playerid]),GetPlayerNameEx(playerid),PlayerInfo[playerid][pHeadValue] / 4 * 2); SendFamilyMessage(8, COLOR_YELLOW, string); format(string,sizeof(string),"You have been critically injured by a hitman and lost $%d!",takemoney); ResetPlayerWeaponsEx(playerid); // SpawnPlayer(playerid); SendClientMessageEx(playerid, COLOR_YELLOW, string); PlayerInfo[playerid][pHeadValue] = 0; PlayerInfo[GetChased[playerid]][pCHits] += 1; SetPlayerHealth(playerid, 0.0); // KillEMSQueue(playerid); GoChase[GetChased[playerid]] = 999; PlayerInfo[GetChased[playerid]][pC4Used] = 0; PlayerInfo[GetChased[playerid]][pC4] = 0; GotHit[playerid] = 0; GetChased[playerid] = 999; new str[128]; new string2[128]; format(string2, sizeof(string2), "* %s turns the engine of their vehicle engine on.", GetPlayerNameEx(playerid)); format(str, sizeof(str), "* %s Failed to start the vehicle because of the car bomb and engine explodes.", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); SendClientMessage(playerid, COLOR_YELLOW, "An hitman just killed you with the car bomb!"); return 1; } } } else { Engine[vehicle] = 1; SetVehicleParamsEx(vehicle,1,lights,alarm,doors,bonnet,boot,objective); format(string, sizeof(string), "* %s turns the engine of their vehicle engine on.", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); return 1; } } else { Engine[vehicle] = 0; SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective); format(string, sizeof(string), "* %s turns the vehicles engine off.", GetPlayerNameEx(playerid)); ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); return 1; } } return engine; } return 1; }
Thank you for helping! Im so glad at your helps!