Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*------------------------------------------------------------------------------
- Proximity Mines & Money Bags Created by Killa[DGZ]
- ------------------------------------------------------------------------------*/
- #define FILTERSCRIPT
- #include <a_samp>
- #define RED 0xFF6347AA
- #define GREY 0xAFAFAFAA
- #define LIGHTBLUE 0x33CCFFAA
- #if defined FILTERSCRIPT
- #define MAX_MINES 25
- #define MAX_MBMINES 25
- enum ProxyMines
- {
- Proxymine,
- Float:MineX,
- Float:MineY,
- Float:MineZ,
- MineObject,
- };
- new Proxycords[MAX_MINES][ProxyMines];
- enum MBProxyMines
- {
- MBProxymine,
- Float:MBMineX,
- Float:MBMineY,
- Float:MBMineZ,
- MBMineObject,
- };
- new MBProxycords[MAX_MBMINES][MBProxyMines];
- public OnFilterScriptInit()
- {
- print("\n----------------------------------------");
- print("Proximity Mines & Money Bags By Killa[DGZ]");
- print("----------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, LIGHTBLUE,"* Proximity Mines & Money Bags, Type: /proxyhelp for more info *");
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- for(new i = 0; i < sizeof(Proxycords); i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, Proxycords[i][MineX], Proxycords[i][MineY], Proxycords[i][MineZ]))
- {
- if(Proxycords[i][Proxymine] == 1)
- {
- new Float:minex, Float:miney, Float:minez;
- GetPlayerPos(playerid,minex, miney, minez);
- CreateExplosion(minex, miney , minez, 6, 10);
- DeleteClosestProxyMine(playerid);
- return 0;
- }
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, MBProxycords[i][MBMineX], MBProxycords[i][MBMineY], MBProxycords[i][MBMineZ]))
- {
- if(MBProxycords[i][MBProxymine] == 1)
- {
- new Float:MBminex, Float:MBminey, Float:MBminez;
- GetPlayerPos(playerid,MBminex, MBminey, MBminez);
- CreateExplosion(MBminex, MBminey , MBminez, 7, 10);
- DeleteClosestMBProxyMine(playerid);
- return 0;
- }
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp(cmdtext,"/proxyhelp",true) == 0)
- {
- SendClientMessage(playerid, RED," * Proximity Mines *");
- SendClientMessage(playerid, LIGHTBLUE,": /spm to set a Proximity Mine *");
- SendClientMessage(playerid, LIGHTBLUE,": /dcpm to delete the Proximity Mine closest to you *");
- SendClientMessage(playerid, LIGHTBLUE,": /dapm to delete all Proximity Mines created *");
- SendClientMessage(playerid, RED," * Proximity Money Bags Bombs *");
- SendClientMessage(playerid, LIGHTBLUE,": /smb to set a Proximity Money Bag Bomb *");
- SendClientMessage(playerid, LIGHTBLUE,": /dcmb to delete the Proximity Money Bag Bomb closest to you *");
- SendClientMessage(playerid, LIGHTBLUE,": /damb to delete all Proximity Money Bag Bombs created *");
- SendClientMessage(playerid, LIGHTBLUE,"");
- SendClientMessage(playerid, GREY,": /proxycredits for credits *");
- return 1;
- }
- if (strcmp(cmdtext,"/proxycredits",true) == 0)
- {
- SendClientMessage(playerid, GREY,"* Proximity Mines & Money Bags - Created By Killa[DGZ] 20-11-2010 *");
- return 1;
- }
- if(strcmp(cmdtext, "/spm", true) == 0)
- {
- new Float:PposX,Float:PposY,Float:PposZ,Float:PposA;
- GetPlayerPos(playerid, PposX, PposY, PposZ);
- GetPlayerFacingAngle(playerid, PposA);
- PposX += (3 * floatsin(-PposA, degrees));
- PposY += (3 * floatcos(-PposA, degrees));
- CreateProxyMine(PposX,PposY,PposZ);
- return 1;
- }
- if(strcmp(cmdtext, "/dcpm", true) == 0)
- {
- DeleteClosestProxyMine(playerid);
- return 1;
- }
- if(strcmp(cmdtext, "/dapm", true) == 0)
- {
- DeleteAllProxyMine();
- return 1;
- }
- if(strcmp(cmdtext, "/smb", true) == 0)
- {
- new Float:PposX,Float:PposY,Float:PposZ,Float:PposA;
- GetPlayerPos(playerid, PposX, PposY, PposZ);
- GetPlayerFacingAngle(playerid, PposA);
- PposX += (3 * floatsin(-PposA, degrees));
- PposY += (3 * floatcos(-PposA, degrees));
- CreateMBProxyMine(PposX,PposY,PposZ);
- return 1;
- }
- if(strcmp(cmdtext, "/dcmb", true) == 0)
- {
- DeleteClosestMBProxyMine(playerid);
- return 1;
- }
- if(strcmp(cmdtext, "/damb", true) == 0)
- {
- DeleteAllMBProxyMine();
- return 1;
- }
- return 0;
- }
- stock CreateProxyMine(Float:x,Float:y,Float:z)
- {
- for(new i = 0; i < sizeof(Proxycords); i++)
- {
- if(Proxycords[i][Proxymine] == 0)
- {
- Proxycords[i][Proxymine]=1;
- Proxycords[i][MineX]=x;
- Proxycords[i][MineY]=y;
- Proxycords[i][MineZ]=z;
- Proxycords[i][MineObject] = CreateObject(1654, x, y, z-0.8,0,0,300);
- return 1;
- }
- }
- return 0;
- }
- stock DeleteClosestProxyMine(playerid)
- {
- for(new i = 0; i < sizeof(Proxycords); i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, Proxycords[i][MineX], Proxycords[i][MineY], Proxycords[i][MineZ]))
- {
- if(Proxycords[i][Proxymine] == 1)
- {
- Proxycords[i][Proxymine]=0;
- Proxycords[i][MineX]=0.0;
- Proxycords[i][MineY]=0.0;
- Proxycords[i][MineZ]=0.0;
- DestroyObject(Proxycords[i][MineObject]);
- return 1;
- }
- }
- }
- return 0;
- }
- stock DeleteAllProxyMine()
- {
- for(new i = 0; i < sizeof(Proxycords); i++)
- {
- if(Proxycords[i][Proxymine] == 1)
- {
- Proxycords[i][Proxymine]=0;
- Proxycords[i][MineX]=0.0;
- Proxycords[i][MineY]=0.0;
- Proxycords[i][MineZ]=0.0;
- DestroyObject(Proxycords[i][MineObject]);
- }
- }
- return 0;
- }
- stock CreateMBProxyMine(Float:x,Float:y,Float:z)
- {
- for(new i = 0; i < sizeof(MBProxycords); i++)
- {
- if(MBProxycords[i][MBProxymine] == 0)
- {
- MBProxycords[i][MBProxymine]=1;
- MBProxycords[i][MBMineX]=x;
- MBProxycords[i][MBMineY]=y;
- MBProxycords[i][MBMineZ]=z;
- MBProxycords[i][MBMineObject] = CreateObject(1550, x, y, z-0.75,0,0,300);
- return 1;
- }
- }
- return 0;
- }
- stock DeleteClosestMBProxyMine(playerid)
- {
- for(new i = 0; i < sizeof(MBProxycords); i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, MBProxycords[i][MBMineX], MBProxycords[i][MBMineY], MBProxycords[i][MBMineZ]))
- {
- if(MBProxycords[i][MBProxymine] == 1)
- {
- MBProxycords[i][MBProxymine]=0;
- MBProxycords[i][MBMineX]=0.0;
- MBProxycords[i][MBMineY]=0.0;
- MBProxycords[i][MBMineZ]=0.0;
- DestroyObject(MBProxycords[i][MBMineObject]);
- return 1;
- }
- }
- }
- return 0;
- }
- stock DeleteAllMBProxyMine()
- {
- for(new i = 0; i < sizeof(MBProxycords); i++)
- {
- if(MBProxycords[i][MBProxymine] == 1)
- {
- MBProxycords[i][MBProxymine]=0;
- MBProxycords[i][MBMineX]=0.0;
- MBProxycords[i][MBMineY]=0.0;
- MBProxycords[i][MBMineZ]=0.0;
- DestroyObject(MBProxycords[i][MBMineObject]);
- }
- }
- return 0;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment