0% found this document useful (0 votes)
23 views1 page

FS Timebomb

This document is a script for a timebomb feature in a game using the SA-MP platform. It includes functions for initializing the script, planting a bomb, and creating an explosion after a specified time. The script also handles player animations and object creation for the bomb.

Uploaded by

cintalunar67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views1 page

FS Timebomb

This document is a script for a timebomb feature in a game using the SA-MP platform. It includes functions for initializing the script, planting a bomb, and creating an explosion after a specified time. The script also handles player animations and object creation for the bomb.

Uploaded by

cintalunar67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <a_samp>

#include <zcmd>
#include <sscanf>
//=============================================
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_WHITE 0xFFFFFFAA
//=============================================
new BombObject[MAX_PLAYERS];
//=============================================
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Timebomb FS by TonyII");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

forward TimeBomb(Float:BX, Float:BY, Float:BZ, playerid);


public TimeBomb(Float:BX, Float:BY, Float:BZ, playerid)
{
CreateExplosion(BX, BY, BZ, 7, 10);
DestroyObject(BombObject[playerid]);
return 1;
}

forward TBObject(Float:BX, Float:BY, Float:BZ, playerid);


public TBObject(Float:BX, Float:BY, Float:BZ, playerid)
{
BombObject[playerid] = CreateObject(1654, BX, BY, BZ-0.97, 0, 90, 4);
SendClientMessage(playerid, COLOR_YELLOW,"You've successfully planted a
timebomb!");
return 1;
}
//=============================================
CMD:plantbomb(playerid, params[])
{
new seconds = strval(params);
if(sscanf(params, "d", seconds)) return SendClientMessage(playerid,
COLOR_WHITE, "/plantbomb [seconds]");
new Float:BX, Float:BY, Float:BZ;
GetPlayerPos(playerid, BX, BY, BZ);
SetTimerEx("TimeBomb", seconds*1000, false, "fff", BX, BY, BZ);
SetTimerEx("TBObject", 3000, false, "fff", BX, BY, BZ);//Without it the
animation will shake because of the object blocking it.
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
return 1;
}

You might also like