Advertisement
Guest User

Hiddos

a guest
Jun 22nd, 2010
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.00 KB | None | 0 0
  1. #include <a_samp>
  2. #include <mapandreas>
  3. #define COLOR_BLUE 0x0000FFFF
  4. public OnFilterScriptInit()
  5. {
  6.     print(" ______________________________________");
  7.     print("|                                      |");
  8.     print("|   The Cowly Cow FilterScript         |");
  9.     print("|  Originally produced by Hiddos       |");
  10.     print("|    Enjoy it               McFaik     |");
  11.     print("|______________________________________|");
  12.     MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
  13.     return 1;
  14. }
  15. public OnFilterScriptExit()
  16. {
  17.     return 1;
  18. }
  19.  
  20.  
  21. public OnPlayerDisconnect(playerid, reason)
  22. {
  23.     if(GetPVarInt(playerid,"CowRider") == 1) DestroyObject(GetPVarInt(playerid,"Object"));
  24.     return 1;
  25. }
  26.  
  27. public OnPlayerCommandText(playerid, cmdtext[])
  28. {
  29.     if (strcmp("/ride", cmdtext, true, 10) == 0)
  30.     {
  31.         if(GetPVarInt(playerid,"CowRider") == 1)
  32.         {
  33.             DestroyObject(GetPVarInt(playerid,"Object"));
  34.             SendClientMessage(playerid,COLOR_BLUE,"You've stopped enjoying a ride on a cow.");
  35.             SetPVarInt(playerid,"CowRider",0);
  36.             TogglePlayerSpectating(playerid,0);
  37.             return 1;
  38.         }
  39.         new object,Float:x,Float:y,Float:z,Float:a,Float:X,Float:Y;
  40.         GetPlayerPos(playerid,x,y,z);
  41.         GetPlayerFacingAngle(playerid,a);
  42.         a+=90;
  43.         object = CreateObject(16442,x+5,y,z+2,0,0,a);
  44.         SetPVarInt(playerid,"CowRider",1);
  45.         SetPVarInt(playerid,"Object",object);
  46.         SendClientMessage(playerid,COLOR_BLUE,"You've climbed into the head of a cow and are now in full control of her brain.");
  47.         TogglePlayerSpectating(playerid,1);
  48.         SetPlayerCameraLookAt(playerid,X,Y,z+2);
  49.         X = x +(5 * floatsin(-a,degrees));
  50.         Y = Y +(5 * floatcos(-a,degrees));
  51.         SetPlayerCameraPos(playerid,X,Y,z+4.2);
  52.         return 1;
  53.     }
  54.     return 0;
  55. }
  56.  
  57. public OnPlayerUpdate(playerid)
  58. {
  59.     if(GetPVarInt(playerid,"CowRider") == 1)
  60.     {
  61.         new Float:x,Float:y,Float:z;
  62.         new Float:X,Float:Y,Float:Z,Float:a;
  63.         new ud,lr,nn;
  64.         GetPlayerKeys(playerid,nn,ud,lr);
  65.         if(ud == 0 && lr == 0) return 1;
  66.         new cow = GetPVarInt(playerid,"Object");
  67.         GetObjectRot(cow,x,y,a);
  68.         new Float:A = a+90;
  69.         GetObjectPos(cow,x,y,z);
  70.         if(ud > 0)
  71.         {
  72.             X = x + (0.2 * floatsin(-A,degrees));
  73.             Y = y + (0.2 * floatcos(-A,degrees));
  74.             MapAndreas_FindZ_For2DCoord(X,Y,Z);
  75.             if(Z - z < 4) SetObjectPos(cow,X,Y,Z+2);
  76.         }
  77.         if(ud < 0 )
  78.         {
  79.             X = x - (0.2 * floatsin(-A,degrees));
  80.             Y = y - (0.2 * floatcos(-A,degrees));
  81.             MapAndreas_FindZ_For2DCoord(X,Y,Z);
  82.             if(Z - z < 2) SetObjectPos(cow,X,Y,Z+2);
  83.         }
  84.         if(lr > 0)
  85.         {
  86.             SetObjectRot(cow,0,0,a-3.5);
  87.             A -= 3.5;
  88.         }
  89.         if(lr < 0)
  90.         {
  91.             SetObjectRot(cow,0,0,a+3.5);
  92.             A += 3.5;
  93.         }
  94.         if(ud != 0)
  95.         {
  96.             SetPlayerCameraLookAt(playerid,X,Y,Z+2);
  97.             X = x +(5 * floatsin(-A,degrees));
  98.             Y = Y +(5 * floatcos(-A,degrees));
  99.             SetPlayerCameraPos(playerid,X,Y,Z+4.2);
  100.         }
  101.         if(ud == 0)
  102.         {
  103.             SetPlayerCameraLookAt(playerid,x,y,z);
  104.             X = x + (5 * floatsin(-A,degrees));
  105.             Y = y + (5 * floatcos(-A,degrees));
  106.             SetPlayerCameraPos(playerid,X,Y,z+2.4);
  107.         }
  108.     }
  109.     return 1;
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement