Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*\
- || ||
- || Created 28th April 2012 By Faisal Khan ([email protected]). ||
- || WARNING: Do NOT Claim This As Your Own. Do NOT Re-Release This Without Permission. ||
- || DO NOT SELL THIS SCRIPT! ||
- || Credits: Faisal ||
- \*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
- //=========================================INCLUDES=============================//
- #include <a_samp>
- //=========================================DEFINES=====================================//
- #define FILTERSCRIPT
- new Text:Textdraw0;
- new Text:Textdraw1;
- new Text:Textdraw2;
- enum mInfo
- {
- Float:mX,
- Float:mY,
- Float:mZ,
- mObject,
- };
- new MineInfo[mInfo];
- public OnFilterScriptInit()
- {
- print("\n--------------------");
- print("Police Car Bomb System");
- print("--------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (newkeys == KEY_YES)
- {
- if (IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) != 411)
- {
- return 1;
- }
- else
- {
- Textdraw2 = TextDrawCreate(380.000000, 180.000000, "Anti-Human");
- TextDrawBackgroundColor(Textdraw2, 255);
- TextDrawFont(Textdraw2, 1);
- TextDrawLetterSize(Textdraw2, 0.500000, 1.000000);
- TextDrawColor(Textdraw2, -1);
- TextDrawSetOutline(Textdraw2, 1);
- TextDrawSetProportional(Textdraw2, 1);
- TextDrawSetShadow(Textdraw2, 1);
- TextDrawUseBox(Textdraw2, 1);
- TextDrawBoxColor(Textdraw2, 16711935);
- TextDrawTextSize(Textdraw2, 480.000000, 15.000000);
- TextDrawSetSelectable(Textdraw2, true);
- Textdraw1 = TextDrawCreate(190.000000, 180.000000, "Anti-Vehicle");
- TextDrawBackgroundColor(Textdraw1, 255);
- TextDrawFont(Textdraw1, 1);
- TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
- TextDrawColor(Textdraw1, -1);
- TextDrawSetOutline(Textdraw1, 1);
- TextDrawSetProportional(Textdraw1, 1);
- TextDrawSetShadow(Textdraw1, 1);
- TextDrawUseBox(Textdraw1, 1);
- TextDrawBoxColor(Textdraw1, 16711935);
- TextDrawTextSize(Textdraw1, 290.000000, 15.000000);
- TextDrawSetSelectable(Textdraw1, true);
- Textdraw0 = TextDrawCreate(329.000000, 140.000000, "Select The Appropriate Option To Place The Mine");
- TextDrawAlignment(Textdraw0, 2);
- TextDrawBackgroundColor(Textdraw0, 255);
- TextDrawFont(Textdraw0, 1);
- TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
- TextDrawColor(Textdraw0, -1);
- TextDrawSetOutline(Textdraw0, 1);
- TextDrawSetProportional(Textdraw0, 1);
- TextDrawSetShadow(Textdraw0, 1);
- TextDrawUseBox(Textdraw0, 1);
- TextDrawBoxColor(Textdraw0, -2139062017);
- TextDrawTextSize(Textdraw0, 1.000000, 410.000000);
- TextDrawShowForPlayer(playerid, Textdraw0);
- TextDrawShowForPlayer(playerid, Textdraw1);
- TextDrawShowForPlayer(playerid, Textdraw2);
- SelectTextDraw(playerid, 0xF0E68CFF); //Khaki Colour
- }
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(!IsPlayerConnected(playerid)) return 0;
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2, MineInfo[mX], MineInfo[mY], MineInfo[mZ]))
- {
- if (IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 411)
- {
- return 1;
- }
- else
- {
- CreateExplosion(MineInfo[mX], MineInfo[mY], MineInfo[mZ], 7, 20.0);
- DestroyObject(MineInfo[mObject]);
- }
- return 0;
- }
- }
- return 1;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(clickedid == Textdraw1)
- {
- if (GetVehicleModel(GetPlayerVehicleID(playerid)) != 411)
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFAA, "You have set an Anti-Vehicle mine.");
- TextDrawDestroy(Textdraw1);
- TextDrawDestroy(Textdraw2);
- TextDrawDestroy(Textdraw0);
- TextDrawSetSelectable(Textdraw1, false);
- new vehicleid;
- new Float:plocx,Float:plocy,Float:plocz;
- GetVehiclePos(vehicleid, plocx, plocy, plocz);
- CreateMine(plocx,plocy,plocz);
- }
- }
- if(clickedid == Textdraw2)
- {
- if (GetVehicleModel(GetPlayerVehicleID(playerid)) != 411)
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFAA, "You have set an Anti-Human mine.");
- TextDrawDestroy(Textdraw1);
- TextDrawDestroy(Textdraw2);
- TextDrawDestroy(Textdraw0);
- TextDrawSetSelectable(Textdraw2, false);
- new vehicleid;
- new Float:plocx,Float:plocy,Float:plocz;
- GetVehiclePos(vehicleid, plocx, plocy, plocz);
- CreateMine(plocx,plocy,plocz);
- }
- }
- return 1;
- }
- stock CreateMine(Float:x,Float:y,Float:z)
- {
- MineInfo[mX]=x;
- MineInfo[mY]=y;
- MineInfo[mZ]=z;
- MineInfo[mObject] = CreateObject(19290, x, y, z-0.85, 0.0, 0.0, 0.0);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement