Face9000

[Face9000] Steal the Area69 Prototype

Jan 23rd, 2014
567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.63 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. main()
  4. {
  5.     print("\n----------------------------------");
  6.     print("Steal the Area69 Prototype by Face9000");
  7.     print("----------------------------------\n");
  8. }
  9.  
  10. new Text3D:ProtLabel[MAX_VEHICLES];
  11. new A69Prot;
  12. new StealingA69Prot[MAX_PLAYERS];
  13.  
  14. public OnGameModeInit()
  15. {
  16.     A69Prot = AddStaticVehicle(428,215.8315,1860.0304,13.2654,1.1393,0,5);
  17.     ProtLabel[A69Prot] = Create3DTextLabel("Area 69 Prototype", 0x00FF00FF, 0.0, 0.0, 0.0, 50.0, 0, 1);
  18.     Attach3DTextLabelToVehicle(ProtLabel[A69Prot],A69Prot, 0.0, 0.0, 0.0);
  19.     return 1;
  20. }
  21.  
  22. public OnGameModeExit()
  23. {
  24.     Delete3DTextLabel(ProtLabel[A69Prot]);
  25.     return 1;
  26. }
  27.  
  28. public OnPlayerConnect(playerid)
  29. {
  30.     StealingA69Prot[playerid] = 0;
  31.     return 1;
  32. }
  33.  
  34. public OnPlayerDisconnect(playerid, reason)
  35. {
  36.     StealingA69Prot[playerid] = 0;
  37.     return 1;
  38. }
  39.  
  40. public OnPlayerDeath(playerid, killerid, reason)
  41. {
  42.     if(StealingA69Prot[playerid] == 1)
  43.     {
  44.     SendClientMessage(playerid, 0x00BFFFAA, "You failed stealing the Area69 Prototype!");
  45.     RemovePlayerMapIcon(playerid,1);
  46.     GivePlayerMoney(playerid, -500);
  47.     StealingA69Prot[playerid] = 0;
  48.     new pname[24];
  49.     GetPlayerName(playerid, pname, 24);
  50.     new kk[128];
  51.     format(kk, sizeof(kk), "** %s (%d) failed stealing Area69 Prototype!",pname,playerid);
  52.     SendClientMessageToAll(0xC93CCE00,kk);
  53.     SetPVarInt(playerid,"StealingTime",GetTickCount()+600000);
  54.     }
  55.     return 1;
  56. }
  57.  
  58. public OnPlayerExitVehicle(playerid, vehicleid)
  59. {
  60.     if(StealingA69Prot[playerid] == 1)
  61.     {
  62.     RemovePlayerMapIcon(playerid,1);
  63.     SendClientMessage(playerid, 0x00BFFFAA, "You left the Area69 Prototype and the mission is failed!");
  64.     GivePlayerMoney(playerid, -500);
  65.     StealingA69Prot[playerid] = 0;
  66.     new pname[24];
  67.     GetPlayerName(playerid, pname, 24);
  68.     new kk[128];
  69.     format(kk, sizeof(kk), "** %s (%d) failed stealing Area69 Prototype!",pname,playerid);
  70.     SendClientMessageToAll(0xC93CCE00,kk);
  71.     SetPVarInt(playerid,"StealingTime",GetTickCount()+600000);
  72.     }
  73.     return 1;
  74. }
  75.  
  76. public OnPlayerStateChange(playerid, newstate, oldstate)
  77. {
  78.     new vehicleidk;
  79.     if(newstate == PLAYER_STATE_DRIVER)
  80.     {
  81.         vehicleidk = GetPlayerVehicleID(playerid);
  82.         if(vehicleidk == A69Prot)
  83.         {
  84.             if(GetPVarInt(playerid,"StealingTime")>GetTickCount())
  85.             {
  86.             SendClientMessage(playerid,0xFF0000FF,"Please wait before stealing the Area69 Prototype again.");
  87.             RemovePlayerFromVehicle(playerid);
  88.             return 1;
  89.             }
  90.             SetPlayerCheckpoint(playerid, -318.6541,1060.9193,19.7422, 20.0);
  91.             SetPlayerMapIcon(playerid,1, -318.6541,1060.9193,19.7422, 41, 0, MAPICON_GLOBAL);
  92.             GameTextForPlayer(playerid, "~w~You are stealing the ~r~Area69 Prototype! Take it back to the ~r~red ~w~checkpoint! (Follow waypoint icon)", 5000, 3);
  93.             SendClientMessage(playerid,0xAA3333AA,"** Don't exit the prototype UNTIL YOU TOOK IT BACK TO THE CHECKPOINT! (Follow waypoint icon!)");
  94.             SendClientMessage(playerid,0xAA3333AA,"** Enemies will try to kill you so watch yourself!");
  95.             StealingA69Prot[playerid] = 1;
  96.             SetPVarInt(playerid,"StealingTime",GetTickCount()+600000);
  97.             new pname[24];
  98.             GetPlayerName(playerid, pname, 24);
  99.             new kk[140];
  100.             new okk[128];
  101.             format(kk, sizeof(kk), "** %s (%d) is stealing the Area69 Prototype, stop him now at all costs!",pname,playerid);
  102.             format(okk, sizeof(okk), "** You can find him by using /loc %s or /loc %d.",pname,playerid);
  103.             SendClientMessageToAll(0xC93CCE00,kk);
  104.             SendClientMessageToAll(0xC93CCE00,okk);
  105.         }
  106.     }
  107.     return 1;
  108. }
  109.  
  110. public OnPlayerEnterCheckpoint(playerid)
  111. {
  112.     if(StealingA69Prot[playerid] == 1)
  113.         {
  114.             new playervehicleid = GetPlayerVehicleID(playerid);
  115.             if(playervehicleid == A69Prot)
  116.             {
  117.                 SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
  118.                 SetVehicleToRespawn(A69Prot);
  119.                 GivePlayerMoney(playerid, 15000);
  120.                 StealingA69Prot[playerid] = 0;
  121.                 GameTextForPlayer(playerid, "You ~r~stole ~w~the ~g~Area69 Prototype ~w~!", 5000, 3);
  122.                 new pname[24];
  123.                 GetPlayerName(playerid, pname, 24);
  124.                 new kk[128];
  125.                 format(kk, sizeof(kk), "** %s (%d) successfully stole the Area69 Prototype!",pname,playerid);
  126.                 SendClientMessageToAll(0xC93CCE00,kk);
  127.                 SetPVarInt(playerid,"StealingTime",GetTickCount()+600000);
  128.                 DisablePlayerCheckpoint(playerid);
  129.                 RemovePlayerMapIcon(playerid,1);
  130.             }
  131.     }
  132.     return 1;
  133. }
Advertisement
Add Comment
Please, Sign In to add comment