Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <mapandreas>
- #define COLOR_BLUE 0x0000FFFF
- public OnFilterScriptInit()
- {
- print(" ______________________________________");
- print("| |");
- print("| The Cowly Cow FilterScript |");
- print("| Originally produced by Hiddos |");
- print("| Enjoy it McFaik |");
- print("|______________________________________|");
- MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(GetPVarInt(playerid,"CowRider") == 1) DestroyObject(GetPVarInt(playerid,"Object"));
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/ride", cmdtext, true, 10) == 0)
- {
- if(GetPVarInt(playerid,"CowRider") == 1)
- {
- DestroyObject(GetPVarInt(playerid,"Object"));
- SendClientMessage(playerid,COLOR_BLUE,"You've stopped enjoying a ride on a cow.");
- SetPVarInt(playerid,"CowRider",0);
- TogglePlayerSpectating(playerid,0);
- return 1;
- }
- new object,Float:x,Float:y,Float:z,Float:a,Float:X,Float:Y;
- GetPlayerPos(playerid,x,y,z);
- GetPlayerFacingAngle(playerid,a);
- a+=90;
- object = CreateObject(16442,x+5,y,z+2,0,0,a);
- SetPVarInt(playerid,"CowRider",1);
- SetPVarInt(playerid,"Object",object);
- SendClientMessage(playerid,COLOR_BLUE,"You've climbed into the head of a cow and are now in full control of her brain.");
- TogglePlayerSpectating(playerid,1);
- SetPlayerCameraLookAt(playerid,X,Y,z+2);
- X = x +(5 * floatsin(-a,degrees));
- Y = Y +(5 * floatcos(-a,degrees));
- SetPlayerCameraPos(playerid,X,Y,z+4.2);
- return 1;
- }
- return 0;
- }
- public OnPlayerUpdate(playerid)
- {
- if(GetPVarInt(playerid,"CowRider") == 1)
- {
- new Float:x,Float:y,Float:z;
- new Float:X,Float:Y,Float:Z,Float:a;
- new ud,lr,nn;
- GetPlayerKeys(playerid,nn,ud,lr);
- if(ud == 0 && lr == 0) return 1;
- new cow = GetPVarInt(playerid,"Object");
- GetObjectRot(cow,x,y,a);
- new Float:A = a+90;
- GetObjectPos(cow,x,y,z);
- if(ud > 0)
- {
- X = x + (0.2 * floatsin(-A,degrees));
- Y = y + (0.2 * floatcos(-A,degrees));
- MapAndreas_FindZ_For2DCoord(X,Y,Z);
- if(Z - z < 4) SetObjectPos(cow,X,Y,Z+2);
- }
- if(ud < 0 )
- {
- X = x - (0.2 * floatsin(-A,degrees));
- Y = y - (0.2 * floatcos(-A,degrees));
- MapAndreas_FindZ_For2DCoord(X,Y,Z);
- if(Z - z < 2) SetObjectPos(cow,X,Y,Z+2);
- }
- if(lr > 0)
- {
- SetObjectRot(cow,0,0,a-3.5);
- A -= 3.5;
- }
- if(lr < 0)
- {
- SetObjectRot(cow,0,0,a+3.5);
- A += 3.5;
- }
- if(ud != 0)
- {
- SetPlayerCameraLookAt(playerid,X,Y,Z+2);
- X = x +(5 * floatsin(-A,degrees));
- Y = Y +(5 * floatcos(-A,degrees));
- SetPlayerCameraPos(playerid,X,Y,Z+4.2);
- }
- if(ud == 0)
- {
- SetPlayerCameraLookAt(playerid,x,y,z);
- X = x + (5 * floatsin(-A,degrees));
- Y = y + (5 * floatcos(-A,degrees));
- SetPlayerCameraPos(playerid,X,Y,z+2.4);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement