Advertisement
Guest User

Untitled

a guest
Jan 17th, 2011
298
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.    Alby Fire's Turtle Race FilterScript
  3.    Don't remove the credits please
  4. */
  5.  
  6. #include <a_samp>
  7. new timer1[MAX_PLAYERS];
  8. new timer2[MAX_PLAYERS];
  9. new timer3[MAX_PLAYERS];
  10. new turtle;
  11. public OnPlayerConnect(playerid)
  12. {
  13.  SendClientMessage(playerid, 0xFFC400FF, "~| Turle Race FS By Alby_Fire Succesfully Loaded! |~");
  14.  return 1;
  15. }
  16. public OnFilterScriptInit()
  17. {
  18.     turtle = CreateObject(1609, 2454.2060546875, -1671.7203369141, 3717.0322265625, 0, 0, 270);
  19.     CreateObject(3115, 2492.1784667969, -1677.1770019531, 3716.1960449219, 0, 0, 0);
  20.     CreateObject(3115, 2513.2160644531, -1677.1402587891, 3716.2473144531, 0, 0, 0);
  21.     CreateObject(3115, 2523.0300292969, -1677.0363769531, 3716.2905273438, 0, 0, 0);
  22.     CreateObject(1640, 2523.5217285156, -1685.3334960938, 3716.6254882813, 0, 0, 0);
  23.     CreateObject(1640, 2523.5229492188, -1683.3831787109, 3716.6201171875, 0, 0, 0);
  24.     CreateObject(1640, 2523.52734375, -1681.4381103516, 3716.6149902344, 0, 0, 0);
  25.     CreateObject(1640, 2523.5339355469, -1679.4910888672, 3716.6096191406, 0, 0, 0);
  26.     CreateObject(1640, 2523.5368652344, -1677.5352783203, 3716.6044921875, 0, 0, 0);
  27.     CreateObject(1640, 2523.5383300781, -1675.5869140625, 3716.6018066406, 0, 0, 0);
  28.     CreateObject(1640, 2523.5480957031, -1673.6447753906, 3716.6018066406, 0, 0, 0);
  29.     CreateObject(1640, 2523.5571289063, -1671.6915283203, 3716.6018066406, 0, 0, 0);
  30.     CreateObject(1640, 2523.5668945313, -1669.7421875, 3716.6018066406, 0, 0, 0);
  31.     CreateObject(1640, 2523.5678710938, -1668.7463378906, 3716.6018066406, 0, 0, 0);
  32.     CreateObject(3115, 2482.0358886719, -1677.1505126953, 3716.1223144531, 0, 0, 0);
  33.     CreateObject(982, 2484.3217773438, -1668.1477050781, 3717.2114257813, 0, 0, 270);
  34.     CreateObject(982, 2509.9521484375, -1668.2413330078, 3717.2514648438, 0, 0, 270);
  35.     CreateObject(982, 2519.5422363281, -1668.3128662109, 3717.2951660156, 0, 0, 270);
  36.     CreateObject(982, 2484.4731445313, -1686.2972412109, 3717.216796875, 0, 0, 270);
  37.     CreateObject(982, 2510.1279296875, -1686.2608642578, 3717.2680664063, 0, 0, 270);
  38.     CreateObject(982, 2519.7409667969, -1686.294921875, 3717.3115234375, 0, 0, 270);
  39.     CreateObject(983, 2532.3762207031, -1671.5133056641, 3717.2719726563, 0, 0, 0);
  40.     CreateObject(983, 2532.3500976563, -1677.8914794922, 3717.2890625, 0, 0, 0);
  41.     CreateObject(983, 2532.2868652344, -1683.1215820313, 3717.3029785156, 0, 0, 0);
  42.     CreateObject(13656, 2581.3688964844, -1692.6591796875, 3679.8757324219, 0, 0, 0);
  43.     CreateObject(2898, 2453.9309082031, -1683.2728271484, 3716.5476074219, 0, 0, 0);
  44.     CreateObject(3115, 2461.798828125, -1676.9761962891, 3716.1938476563, 0, 0, 0);
  45.     CreateObject(982, 2463.6369628906, -1686.2396240234, 3717.21484375, 0, 0, 270);
  46.     CreateObject(982, 2463.5263671875, -1668.1147460938, 3717.1857910156, 0, 0, 270);
  47.     CreateObject(983, 2451.4733886719, -1683.0708007813, 3717.2153320313, 0, 0, 0);
  48.     CreateObject(983, 2451.4812011719, -1676.7232666016, 3717.2153320313, 0, 0, 0);
  49.     CreateObject(983, 2451.4814453125, -1671.3221435547, 3717.2153320313, 0, 0, 0);
  50.     CreateObject(2898, 2453.5473632813, -1671.0013427734, 3716.5485839844, 0, 0, 0);
  51.     CreateObject(14889, 2524.4089355469, -1682.1096191406, 3683.7888183594, 0, 0, 0);
  52.     CreateObject(1504, 162.51335144043, 135.98222351074, 475.64395141602, 0, 0, 0);
  53.     AddStaticPickup(1239, 2, 2526.7527,-1678.6660,3682.5388);
  54.     AddStaticPickup(1239, 2, 2524.7017,-1678.5266,3682.5388);
  55.     AddStaticPickup(1239, 2, 2522.0200,-1678.5378,3682.5461);
  56.     AddStaticPickup(1247, 2, 2526.1855,-1677.0121,3717.6030);
  57.     Create3DTextLabel("Race Level 1",0xCD7F32FF,2526.7527,-1678.6660,3683.3388,40.0,0);
  58.     Create3DTextLabel("Race Level 2",0xC0C0C0FF,2524.7017,-1678.5266,3683.3388,40.0,0);
  59.     Create3DTextLabel("Race Level 3",0xFFD700FF,2522.0200,-1678.5378,3683.3388,40.0,0);
  60.     return 1;
  61. }
  62. forward timerstart1(playerid);
  63. public timerstart1(playerid)
  64. {
  65.  new Float:X, Float:Y, Float:Z;
  66.  GetPlayerPos(playerid, X, Y, Z);
  67.  TogglePlayerControllable(playerid, 1);
  68.  MoveObject(turtle,2529.0247,-1675.6489,3717.5994,7.0);
  69.  KillTimer(timer1[playerid]);
  70.  SetCameraBehindPlayer(playerid);
  71.  SetPlayerFacingAngle(playerid,270.4192);
  72.  GameTextForPlayer(playerid,"~y~go go go !!", 1000, 3);
  73.  PlayerPlaySound(playerid,1057,X,Y,Z);
  74. }
  75. forward timerstart2(playerid);
  76. public timerstart2(playerid)
  77. {
  78.  new Float:X, Float:Y, Float:Z;
  79.  GetPlayerPos(playerid, X, Y, Z);
  80.  TogglePlayerControllable(playerid, 1);
  81.  MoveObject(turtle,2529.0247,-1675.6489,3717.5994,8.5);
  82.  KillTimer(timer2[playerid]);
  83.  SetCameraBehindPlayer(playerid);
  84.  SetPlayerFacingAngle(playerid,270.4192);
  85.  GameTextForPlayer(playerid,"~y~go go go !!", 1000, 3);
  86.  PlayerPlaySound(playerid,1057,X,Y,Z);
  87. }
  88. forward timerstart3(playerid);
  89. public timerstart3(playerid)
  90. {
  91.  new Float:X, Float:Y, Float:Z;
  92.  GetPlayerPos(playerid, X, Y, Z);
  93.  TogglePlayerControllable(playerid, 1);
  94.  MoveObject(turtle,2529.0247,-1675.6489,3717.5994,9.9);
  95.  KillTimer(timer3[playerid]);
  96.  SetCameraBehindPlayer(playerid);
  97.  SetPlayerFacingAngle(playerid,270.4192);
  98.  GameTextForPlayer(playerid,"~y~go go go !!", 1000, 3);
  99.  PlayerPlaySound(playerid,1057,X,Y,Z);
  100. }
  101.  
  102. public OnPlayerCommandText(playerid, cmdtext[])
  103. {
  104.     if (strcmp("/turtlerace", cmdtext, true, 10) == 0)
  105.     {
  106.       SetPlayerPos(playerid, 2524.8247,-1682.7988,3682.5388);
  107.       SendClientMessage(playerid, 0x0BDE00FF, "* Welcome to the Turtle Race, you can choice 3 difference Levels.");
  108.       return 1;
  109.     }
  110.     return 0;
  111. }
  112. public OnPlayerUpdate(playerid)
  113. {
  114.  if(IsPlayerInRangeOfPoint(playerid, 1, 2526.7527,-1678.6660,3682.5388))
  115.  {
  116.   SetPlayerPos(playerid, 2453.4229,-1683.6077,3717.5776);
  117.   TogglePlayerControllable(playerid, 0);
  118.   timer1[playerid] = SetTimerEx("timerstart1", 5000, true, "d", playerid);
  119.   GameTextForPlayer(playerid,"prepare to race number 1...", 5000, 3);
  120.   SetPlayerCameraPos(playerid,2453.4229,-1683.6077,3724.5776);
  121.   SetPlayerCameraLookAt(playerid,2456.7129,-1675.9921,3717.5188);
  122.  }
  123.  if(IsPlayerInRangeOfPoint(playerid, 1, 2524.7017,-1678.5266,3683.3388))
  124.  {
  125.   SetPlayerPos(playerid, 2453.4229,-1683.6077,3717.5776);
  126.   TogglePlayerControllable(playerid, 0);
  127.   timer2[playerid] = SetTimerEx("timerstart2", 5000, true, "d", playerid);
  128.   GameTextForPlayer(playerid,"prepare to race number 2...", 5000, 3);
  129.   SetPlayerCameraPos(playerid,2453.4229,-1683.6077,3724.5776);
  130.   SetPlayerCameraLookAt(playerid,2456.7129,-1675.9921,3717.5188);
  131.  }
  132.  if(IsPlayerInRangeOfPoint(playerid, 1, 2522.0200,-1678.5378,3683.3388))
  133.  {
  134.   SetPlayerPos(playerid, 2453.4229,-1683.6077,3717.5776);
  135.   TogglePlayerControllable(playerid, 0);
  136.   timer3[playerid] = SetTimerEx("timerstart3", 5000, true, "d", playerid);
  137.   GameTextForPlayer(playerid,"prepare to race number 3...", 5000, 3);
  138.   SetPlayerCameraPos(playerid,2453.4229,-1683.6077,3724.5776);
  139.   SetPlayerCameraLookAt(playerid,2456.7129,-1675.9921,3717.5188);
  140.  }
  141.  if(ObjectToPoint(3, turtle, 2527.1516,-1676.6982,3717.6023))
  142.  {
  143.   if(!IsPlayerInRangeOfPoint(playerid, 2, 2526.7527,-1678.6660,3682.5388))
  144.   {
  145.     GameTextForPlayer(playerid,"~r~You Loose!", 3000, 3);
  146.     DestroyObject(turtle);
  147.     turtle = CreateObject(1609, 2454.2060546875, -1671.7203369141, 3717.0322265625, 0, 0, 270);
  148.     SetPlayerPos(playerid, 2524.8247,-1682.7988,3682.5388);
  149.   }
  150.  }
  151.  if(IsPlayerInRangeOfPoint(playerid, 2, 2526.1855,-1677.0121,3717.6030))
  152.  {
  153.     GameTextForPlayer(playerid,"~g~You Win!", 3000, 3);
  154.     DestroyObject(turtle);
  155.     turtle = CreateObject(1609, 2454.2060546875, -1671.7203369141, 3717.0322265625, 0, 0, 270);
  156.     SetPlayerPos(playerid, 2524.8247,-1682.7988,3682.5388);
  157.  }
  158.  return 1;
  159. }
  160. stock ObjectToPoint(Float:radi, objectid, Float:x, Float:y, Float:z)
  161. {
  162.   new Float:oldposx, Float:oldposy, Float:oldposz;
  163.   new Float:tempposx, Float:tempposy, Float:tempposz;
  164.   GetObjectPos(objectid, oldposx, oldposy, oldposz);
  165.   tempposx = (oldposx -x);
  166.   tempposy = (oldposy -y);
  167.   tempposz = (oldposz -z);
  168.   if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  169.   {
  170.    return 1;
  171.   }
  172.   return 0;
  173. }
Advertisement
RAW Paste Data Copied
Advertisement