Can anyone tell me whats wrong here?
#9

Answer to your question (in your other topic)

@offtopic
I am just wondering about the usage of cos and sin in IsPlayerNearWater if you only check for North / East / South / West
Also if its a small loop you should unroll it for speed
PHP код:
IsPlayerNearWater(playerid) {
    const
        
FloatTHRESHOLD 20.0,
        
FloatRADIUS 4.0;
    new
        
Floatx,
        
Floaty,
        
Floatz;
    if(
GetPlayerPos(playeridxyz) && (-THRESHOLD THRESHOLD)) {
        
MapAndreas_FindZ_For2DCoord(xRADIUSz);
        if(
== 0.0) return true;
        
MapAndreas_FindZ_For2DCoord(RADIUSyz);
        if(
== 0.0) return true;
        
MapAndreas_FindZ_For2DCoord(xRADIUSz);
        if(
== 0.0) return true;
        
MapAndreas_FindZ_For2DCoord(RADIUSyz);
        if(
== 0.0) return true;
    }
    return 
false;

You should add a IsPlayerNearWater check in /fish if it isn't already there
Reply


Messages In This Thread
Can anyone tell me whats wrong here? - by MayaEU - 20.07.2016, 17:50
Re: Can anyone tell me whats wrong here? - by gurmani11 - 20.07.2016, 18:58
Re: Can anyone tell me whats wrong here? - by MayaEU - 20.07.2016, 19:16
Re: Can anyone tell me whats wrong here? - by Stinged - 20.07.2016, 19:26
Re: Can anyone tell me whats wrong here? - by MayaEU - 20.07.2016, 19:34
Re: Can anyone tell me whats wrong here? - by MayaEU - 20.07.2016, 19:37
Re: Can anyone tell me whats wrong here? - by Stinged - 20.07.2016, 19:42
Re: Can anyone tell me whats wrong here? - by MayaEU - 20.07.2016, 20:08
Re: Can anyone tell me whats wrong here? - by Nero_3D - 20.07.2016, 23:40

Forum Jump:


Users browsing this thread: 1 Guest(s)