#include <a_samp>
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
new Float:X[MAX_PLAYERS];
new Float:Y[MAX_PLAYERS];
new Float:Z[MAX_PLAYERS];
new Float:A[MAX_PLAYERS];
new Float:B[MAX_PLAYERS];
new Float:C[MAX_PLAYERS];
new Float:D[MAX_PLAYERS];
new Float:E[MAX_PLAYERS];
new Float:F[MAX_PLAYERS];
#define MAX_PLAYERS 100;
new prime_arr[MAX_PLAYERS]; //global variable. Set all cells to 0 into main() or onGameModeInit().
#define COLOR_YELLOW 0xFFFF00AA
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
// Bomb commands
if (strcmp("/prime", cmdtext, true, 10) == 0)
{
prime_arr[playerid]=1;
SendClientMessage(playerid, 0x33AA33AA,"Bomb has been primed, press ACTION to detonate");
return 1;
}
// weapon give commands
if (strcmp("/grenade", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,16,1000);
return 1;
}
if (strcmp("/rocket", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,35,1000);
return 1;
}
if (strcmp("/molotov", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,18,1000);
return 1;
}
if (strcmp("/heat", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,36,1000);
return 1;
}
if (strcmp("/flame", cmdtext, true, 10) == 0)
{
GivePlayerWeapon(playerid,37,1000);
return 1;
}
// weapon give all commands
if (strcmp("/grenadeall", cmdtext, true, 10) == 0)
{
SetTimer("grenade",100,0);
return 1;
}
if (strcmp("/rocketall", cmdtext, true, 10) == 0)
{
SetTimer("rocket",100,0);
return 1;
}
if (strcmp("/molotovall", cmdtext, true, 10) == 0)
{
SetTimer("molotov",100,0);
return 1;
}
if (strcmp("/heatall", cmdtext, true, 10) == 0)
{
SetTimer("heat",100,0);
return 1;
}
if (strcmp("/flameall", cmdtext, true, 10) == 0)
{
SetTimer("flame",100,0);
return 1;
}
//character command
if (strcmp("/pyroman", cmdtext, true, 10) == 0)
{
SetPlayerSkin(playerid,16);
SetPlayerColor(playerid,0xAFAFAFAA);
SetPlayerArmour(playerid,100);
SetPlayerHealth(playerid,100);
return 1;
}
//bomb command
if (strcmp("/drop", cmdtext, true, 10) == 0)
{
GetPlayerPos(playerid,Float:A[playerid],Float:B[playerid],Float:C[playerid]);
ApplyAnimation(playerid,"BOMBER","BOM_PLANT",4.0,0,0,0,0,0);
CreatePickup(1252,1,Float:A[playerid],Float:B[playerid],Float:C[playerid]);
return 1;
}
if (strcmp("/countdown", cmdtext, true, 10) == 0)
{
SetTimer("countdown",10000,0);
return 1;
}
// flare
if (strcmp("/flare", cmdtext, true, 10) == 0)
{
GetPlayerPos(playerid,Float:D[playerid],Float:E[playerid],Float:F[playerid]);
CreatePickup(354,1,Float:D[playerid],Float:E[playerid],Float:F[playerid]);
return 1;
}
return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys == 1)
{
if(prime_arr[playerid]==1)
{
GetPlayerPos(playerid,Float:X[playerid],Float:Y[playerid],Float:Z[playerid]);
CreateExplosion(Float:X[playerid],Float:Y[playerid],Float:Z[playerid],8,8);
}
else
{
SendClientMessage(playerid, 0x33AA33AA,"/prime the bomb!");
}
return 1;
}
public grenade(playerid)
{
SendClientMessageToAll(#00CC00,"Grenades have been given to all);
GivePlayerWeapon(playerid,16,1000);
return 1;
}
public rocket(playerid)
{
SendClientMessageToAll(#00CC00,"RPGs have been given to all);
GivePlayerWeapon(playerid,35,1000);
return 1;
}
public molotov(playerid)
{
SendClientMessageToAll(#00CC00,"Molotovs have been given to all);
GivePlayerWeapon(playerid,18,1000);
return 1;
}
public heat(playerid)
{
SendClientMessageToAll(#00CC00,"Heat seekers have been given to all);
GivePlayerWeapon(playerid,36,1000);
return 1;
}
public flame(playerid)
{
SendClientMessageToAll(#00CC00,"Flamethrowers have been given to all);
GivePlayerWeapon(playerid,37,1000);
return 1;
}
public countdown(playerid)
{
CreateExplosion(Float:A[playerid],Float:B[playerid],Float:C[playerid],8,8);
return 1;
}