[FilterScript] Hunting System
#21

Update v1.2.0:

- Fixed underground spawn

- Added check if spawn pos is out of moving_area

- Added check if spawn pos is out of world

- Updated example code

- Changed function:
PHP код:
Hunting::GoTo(mobid,Float:x,Float:y,bool:disable_moving=false);
Hunting::Stop(mobid,delay=-1);
Hunting::Kill(mobid,playerid=INVALID_PLAYER_ID); 
- Changed callback:
PHP код:
OnPlayerTakeHuntDrop(playerid,mobid,drop); //return 0 set drop flag 0 
- Added functions:
PHP код:
Hunting::SetPos(mobid,Float:x,Float:y,Float:z,bool:disable_moving=false);
Hunting::ForceRespawn(mobid,Float:x,Float:y,Float:z);
Hunting::GetScaredRange(mobid);
Hunting::SetScaredRange(mobid,Float:range);
Hunting::GetPressTime(mobid);
Hunting::SetPressTime(mobid,miliseconds);
Hunting::GetFacingAngle(mobid);
Hunting::IsScared(mobid);
Hunting::IsPlayerInRange(playerid,mobid,Float:range); 
- Added extended function:
PHP код:
Hunting::GetActiveMob(playerid,mob_state); 
- Added callback:
PHP код:
OnAnimalScareStateChanged(mobid,playerid,isscared);
OnPlayerHuntDropStateChange(playerid,mobid,drop_state); //only called if press time > 0 
- Added definitions:
PHP код:
HUNTING_DROP_STATE_FINISH
HUNTING_DROP_STATE_START
HUNTING_DROP_STATE_INTERRUPT 
Reply
#22

Update v1.3.0:

- Minor bug fixes

- Added functions:
PHP код:
Hunting::IsMoving(mobid);
Hunting::IsStopped(mobid);
Hunting::SetCalmTime(mobid,time=0); 
- Added callback:
PHP код:
OnPlayerExitApproachingAnimal(playerid,mobid,mob_state); 
Reply
#23

When i kill few deers, in few minutes, its like include disabled, deers in air, no movements, no actions on shoot, fix?

photo: http://prntscr.com/giuce5
Reply
#24

Quote:
Originally Posted by Danisoni
Посмотреть сообщение
When i kill few deers, in few minutes, its like include disabled, deers in air, no movements, no actions on shoot, fix?

photo: http://prntscr.com/giuce5
Show you hunting callbacks and animal creation code.
Reply
#25

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
Show you hunting callbacks and animal creation code.
Creation - OnGameModeInit:
Код:
new huntzone = CreateDynamicRectangle(2199.00, -773.00, 2517.00, -517.00);
	for(new i = 0; i < 12; i++){
 	Hunting::Create(HUNTING_TYPE_DEER,2328.1748,-591.6104,129.7921,1.0,30,.moving_area=huntzone);
 }
Код:
public OnPlayerTakeHuntDrop(playerid,mobid,drop){ //Didnt used this jet...

    if(drop){
        new meso = random(10)+10;
        new platica = meso*7;
        Msg1( playerid, "(Lov) U ovom jelenu ima {68DAFF}%d kila mesa"B1", dobit ces dodatnih {68DAFF}%d$ "B1"na platu.", meso, platica);
    }
    return 0;
}

public OnPlayerKillHuntAnimal(playerid,mobid){
    return 1;
}

public OnPlayerApproachingAnimal(playerid,mobid,mob_state){
    return 1;
}

public OnAnimalScareStateChanged(mobid,playerid,isscared){

    if(isscared){
        Msg1( playerid, "(Lov) Uplasio si {FC3737}jelena"B1", budi oprezniji.");
    }
    return 1;
}
Reply
#26

Update v1.3.1:

- Fix server freeze after mob respawn
Reply
#27

PHP код:
#define _ :: 
CPawn++

Good job Abyss!
Reply
#28

Quote:
Originally Posted by XeonMaster
Посмотреть сообщение
PHP код:
#define _ :: 
CPawn++

Good job Abyss!
This is not idea for C++ XD
This is idea for more readable function names.
Reply
#29

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
This is not idea for C++ XD
This is idea for more readable function names.
excepted xD
Reply
#30

amazing
Reply
#31

I pmed you about infinite loop or server freeze problem, check it
Reply
#32

Good idea. Might be useful for an RPG-type server.
Reply
#33

Update v1.4.0

- Fix random server crash/freeze
Reply
#34

well done
Reply
#35

Perfect!!
Reply
#36

Update v1.4.1:

- Minor fixes for data validation
Reply
#37

Not working for me...

new huntzone = CreateDynamicRectangle(2199.00, -773.00, 2517.00, -517.00);
for(new i = 0; i < 12; i++){
Hunting::Create(HUNTING_TYPE_DEER,2328.1748,-591.6104,129.7921,1.0,30,.moving_area=huntzone);
}

[ADM] Error: Failed to Hunting::Create(19315,2328.174804,-591.610412,129.792098,...) position out of world
Reply
#38

anyone have the download link?
Reply
#39

please link?
Reply
#40

link?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)