Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:plantbomb(playerid, params[])
- {
- if (GetPVarInt(playerid, "Bomb") == 0)
- {
- SendClientMessage(playerid, -1, "{CC0000}Error: {FFFFFF}You do not have a {CC0000}bomb!");
- return 1;
- }
- -> if (GetPVarInt(playerid, "Plant") == 1)
- {
- SendClientMessage(playerid, -1, "{CC0000}Error: {FFFFFF}You need to wait before {CC0000}planting again!");
- return 1;
- }
- new Float:fpX, Float:fpY, Float:fpZ, szString[124];
- GetPlayerPos(playerid, fpX, fpY, fpZ);
- fBombX = fpX;
- fBombY = fpY;
- fBombZ = fpZ-1.5;
- SetTimer("Explode", BombTimer * 1000, 0);
- SetTimerEx("ResetPlant", 20 * 60 * 1000, false, "i", playerid);
- SetPVarInt(playerid, "Bomb", 0);
- SetPVarInt(playerid, "Plant", 1);
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
- iPlanter = playerid;
- format(szString, 124, "{FFFFFF}You have planted a bomb in your location and it will explode in {CC0000}%d seconds", BombTimer);
- SendClientMessage(playerid, -1, szString);
- #if Realism == 1
- {
- CreateObject(1252, fpX, fpY, fpZ-1.4, 0, 0, 0); // 'fpZ-1.4' may be inaccurate. Be aware.
- Timer = SetTimer("Beep", 4000, 1);
- }
- #endif
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement