Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define abs(%0) ((%0) >= 0 ? (%0) : -(%0))
- new loser = -1, cowly_cow, tiemr[2];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Stalker Cows, another useless script");
- print(" made by Hiddos. I'm wondering why");
- print(" you're using this. Type 'unloadfs stalkercows'");
- print(" right now and save yourself.");
- print("--------------------------------------\n");
- cowly_cow = CreateObject(16442, 0, 0, 0, 0, 0, 0);
- ChooseNewLoser();
- tiemr[0] = SetTimer("ChooseNewLoser", 60 * 1000, true);
- tiemr[1] = SetTimer("DatOtherCallback", 28 * 100, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(tiemr[0]);
- KillTimer(tiemr[1]);
- DestroyObject(cowly_cow); //Bai bai cow :(
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(playerid == loser) ChooseNewLoser();
- return 1;
- }
- /* Gary the Plumber: A story about Gary
- Do you know Gary the Plumber? No? You idiot. Well, here it goes:
- Gary the Plumber is a guy from somewhere in England (I couldn't be arsed to
- come up with a location). He's 24 years old and just bought a new rubber
- chair to beat his fish with. Even though his name might make you think
- otherwise, Gary is a Plumber. He recommends you not to become a plumber.
- Anyhow, Gary lived happily ever after!
- The end of this romantic story kids. Hope for something better
- in my next release.
- */
- forward ChooseNewLoser();
- public ChooseNewLoser()
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i)) break;
- if(i == MAX_PLAYERS - 1) { loser = -1; return; }
- }
- new target = -1;
- while(!IsPlayerConnected(target))
- {
- target = random(MAX_PLAYERS);
- }
- loser = target;
- new Float:Pos[4];
- if(IsPlayerInAnyVehicle(loser)) GetVehiclePos(GetPlayerVehicleID(loser), Pos[0], Pos[1], Pos[2]);
- else GetPlayerPos(loser, Pos[0], Pos[1], Pos[2]);
- Pos[0] += float(random(30) - 15);
- Pos[1] += float(random(30) - 15);
- StopObject(cowly_cow);
- SetObjectPos(cowly_cow, Pos[0], Pos[1], Pos[2] - 7.5);
- MoveObject(cowly_cow, Pos[0], Pos[1], Pos[2], 5.0);
- }
- stock Float:GetPlayerSpeed(playerid)
- {
- new Float:x,Float:y,Float:z;
- if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
- else GetPlayerVelocity(playerid,x,y,z);
- return floatsqroot(x*x+y*y+z*z) * 48.5;
- }
- forward DatOtherCallback();
- public DatOtherCallback()
- {
- if(loser == -1) return;
- new Float:Pos[7];
- GetObjectPos(cowly_cow, Pos[0], Pos[1], Pos[2]);
- if(IsPlayerInAnyVehicle(loser)) GetVehiclePos(GetPlayerVehicleID(loser), Pos[3], Pos[4], Pos[5]);
- else GetPlayerPos(loser, Pos[3], Pos[4], Pos[5]);
- Pos[3] += float(random(10) - 5);
- Pos[4] += float(random(10) - 5);
- Pos[6] = atan( floatdiv(abs(Pos[4] - Pos[1]), abs(Pos[3] - Pos[0])) );
- if(Pos[3] < Pos[0] && Pos[4] < Pos[1]) Pos[6] += 180;
- else if(!(Pos[3] > Pos[0] && Pos[4] > Pos[1]))
- {
- Pos[6] *= float(-1);
- Pos[6] += float((Pos[3] > Pos[0] && Pos[4] < Pos[1]) ? (90) : (270));
- Pos[6] -= float(90);
- }
- SetObjectRot(cowly_cow, 0, 0, Pos[6]);
- MoveObject(cowly_cow, Pos[3], Pos[4], Pos[5] + 1.2, GetPlayerSpeed(loser) + 7.8);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement