Advertisement
Faisal_khan

Error

May 3rd, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.38 KB | None | 0 0
  1. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*\
  2. ||                                                                                            ||
  3. ||                      Created 28th April 2012 By Faisal Khan ([email protected]).                                 ||
  4. ||      WARNING: Do NOT Claim This As Your Own. Do NOT Re-Release This Without Permission.    ||
  5. ||                                  DO NOT SELL THIS SCRIPT!                                  ||
  6. ||                                        Credits: Faisal                                                ||
  7. \*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
  8. //=========================================INCLUDES=============================//
  9. #include <a_samp>
  10. //=========================================DEFINES=====================================//
  11. #define FILTERSCRIPT
  12. new Text:Textdraw0;
  13. new Text:Textdraw1;
  14. new Text:Textdraw2;
  15.  
  16. enum mInfo
  17. {
  18.     Float:mX,
  19.     Float:mY,
  20.     Float:mZ,
  21.     mObject,
  22. };
  23. new MineInfo[mInfo];
  24.  
  25. public OnFilterScriptInit()
  26. {
  27.     print("\n--------------------");
  28.     print("Police Car Bomb System");
  29.     print("--------------------\n");
  30.     return 1;
  31. }
  32.  
  33. public OnFilterScriptExit()
  34. {
  35.     return 1;
  36. }
  37.  
  38. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  39. {
  40.     if (newkeys == KEY_YES)
  41.     {
  42.         if (IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) != 411)
  43.         {
  44.             return 1;
  45.         }
  46.         else
  47.         {
  48.             Textdraw2 = TextDrawCreate(380.000000, 180.000000, "Anti-Human");
  49.             TextDrawBackgroundColor(Textdraw2, 255);
  50.             TextDrawFont(Textdraw2, 1);
  51.             TextDrawLetterSize(Textdraw2, 0.500000, 1.000000);
  52.             TextDrawColor(Textdraw2, -1);
  53.             TextDrawSetOutline(Textdraw2, 1);
  54.             TextDrawSetProportional(Textdraw2, 1);
  55.             TextDrawSetShadow(Textdraw2, 1);
  56.             TextDrawUseBox(Textdraw2, 1);
  57.             TextDrawBoxColor(Textdraw2, 16711935);
  58.             TextDrawTextSize(Textdraw2, 480.000000, 15.000000);
  59.             TextDrawSetSelectable(Textdraw2, true);
  60.  
  61.             Textdraw1 = TextDrawCreate(190.000000, 180.000000, "Anti-Vehicle");
  62.             TextDrawBackgroundColor(Textdraw1, 255);
  63.             TextDrawFont(Textdraw1, 1);
  64.             TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
  65.             TextDrawColor(Textdraw1, -1);
  66.             TextDrawSetOutline(Textdraw1, 1);
  67.             TextDrawSetProportional(Textdraw1, 1);
  68.             TextDrawSetShadow(Textdraw1, 1);
  69.             TextDrawUseBox(Textdraw1, 1);
  70.             TextDrawBoxColor(Textdraw1, 16711935);
  71.             TextDrawTextSize(Textdraw1, 290.000000, 15.000000);
  72.             TextDrawSetSelectable(Textdraw1, true);
  73.  
  74.             Textdraw0 = TextDrawCreate(329.000000, 140.000000, "Select The Appropriate Option To Place The Mine");
  75.             TextDrawAlignment(Textdraw0, 2);
  76.             TextDrawBackgroundColor(Textdraw0, 255);
  77.             TextDrawFont(Textdraw0, 1);
  78.             TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
  79.             TextDrawColor(Textdraw0, -1);
  80.             TextDrawSetOutline(Textdraw0, 1);
  81.             TextDrawSetProportional(Textdraw0, 1);
  82.             TextDrawSetShadow(Textdraw0, 1);
  83.             TextDrawUseBox(Textdraw0, 1);
  84.             TextDrawBoxColor(Textdraw0, -2139062017);
  85.             TextDrawTextSize(Textdraw0, 1.000000, 410.000000);
  86.            
  87.             TextDrawShowForPlayer(playerid, Textdraw0);
  88.             TextDrawShowForPlayer(playerid, Textdraw1);
  89.             TextDrawShowForPlayer(playerid, Textdraw2);
  90.             SelectTextDraw(playerid, 0xF0E68CFF); //Khaki Colour
  91.         }
  92.     }
  93.     return 1;
  94. }
  95.  
  96. public OnPlayerUpdate(playerid)
  97. {
  98.     if(!IsPlayerConnected(playerid)) return 0;
  99.     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  100.     {
  101.             if(IsPlayerInRangeOfPoint(playerid, 2, MineInfo[mX], MineInfo[mY], MineInfo[mZ]))
  102.             {
  103.                     if (IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 411)
  104.                     {
  105.                         return 1;
  106.                     }
  107.                     else
  108.                     {
  109.                         CreateExplosion(MineInfo[mX], MineInfo[mY], MineInfo[mZ], 7, 20.0);
  110.                         DestroyObject(MineInfo[mObject]);
  111.                     }
  112.                     return 0;
  113.             }
  114.     }
  115.     return 1;
  116. }
  117.  
  118. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  119. {
  120.     if(clickedid == Textdraw1)
  121.     {
  122.          if (GetVehicleModel(GetPlayerVehicleID(playerid)) != 411)
  123.          {
  124.              return 1;
  125.          }
  126.          else
  127.          {
  128.              SendClientMessage(playerid, 0xFFFFFFAA, "You have set an Anti-Vehicle mine.");
  129.              TextDrawDestroy(Textdraw1);
  130.              TextDrawDestroy(Textdraw2);
  131.              TextDrawDestroy(Textdraw0);
  132.              TextDrawSetSelectable(Textdraw1, false);
  133.              new vehicleid;
  134.              new Float:plocx,Float:plocy,Float:plocz;
  135.              GetVehiclePos(vehicleid, plocx, plocy, plocz);
  136.              CreateMine(plocx,plocy,plocz);
  137.          }
  138.     }
  139.     if(clickedid == Textdraw2)
  140.     {
  141.          if (GetVehicleModel(GetPlayerVehicleID(playerid)) != 411)
  142.          {
  143.              return 1;
  144.          }
  145.          else
  146.          {
  147.              SendClientMessage(playerid, 0xFFFFFFAA, "You have set an Anti-Human mine.");
  148.              TextDrawDestroy(Textdraw1);
  149.              TextDrawDestroy(Textdraw2);
  150.              TextDrawDestroy(Textdraw0);
  151.              TextDrawSetSelectable(Textdraw2, false);
  152.              new vehicleid;
  153.              new Float:plocx,Float:plocy,Float:plocz;
  154.              GetVehiclePos(vehicleid, plocx, plocy, plocz);
  155.              CreateMine(plocx,plocy,plocz);
  156.          }
  157.     }
  158.     return 1;
  159. }
  160.  
  161. stock CreateMine(Float:x,Float:y,Float:z)
  162. {
  163.     MineInfo[mX]=x;
  164.     MineInfo[mY]=y;
  165.     MineInfo[mZ]=z;
  166.     MineInfo[mObject] = CreateObject(19290, x, y, z-0.85, 0.0, 0.0, 0.0);
  167.     return 1;
  168. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement