Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerUpdate(playerid)
- {
- new Float:x, Float:y, Float:z; GetObjectPos(Shark, x, y, z);
- if(IsPlayerInRangeOfPoint(playerid, 40, x, y, z))
- {
- new Float:x2, Float:y2, Float:z2; GetPlayerPos(playerid, x2, y2, z2);
- MoveObject(Shark, x2, y2, z2, 4.0);
- SetObjectToFaceCords(Shark, x2, y2, z2);
- if(SharkBite[playerid] == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5, x, y, z))
- {
- new Float:x3, Float:y3, Float:z3; GetObjectPos(Shark, x3, y3, z3);
- SetObjectPos(Shark, x3, y3, z3);
- SetObjectToFaceCords(Shark, x2, y2, z2);
- new Float:health; GetPlayerHealth(playerid, health);
- SetPlayerHealth(playerid, health - 20);
- GameTextForPlayer(playerid, "~r~The shark bit you!", 3000, 4);
- SharkBite[playerid] = 1;
- SetTimerEx("SharkBiteTimer", 5000, false, "u", playerid);
- }
- }
- }
- else
- {
- MoveObject(Shark, -973.2335, 2654.5559, 40.0119, 4.0);
- SetObjectToFaceCords(Shark, -973.2335, 2654.5559, 40.0119);
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment