Give money for player
#4

You might get more than one result and thus reward more than one player; so make sure you get the proper distance from point and then compare it with the next value, will be more accurate this way.

PHP код:
                    new Float:x8Float:y8Float:z8Float:_distMax_closePlayer;
                    
GetObjectPos(Object_IDx8y8z8);
                    for(new 
p,j=GetPlayerPoolSize(); <=jp++)
                    {
                        if(!
IsPlayerConnected(p) || IsPlayerNPC(p)) continue;
                        if(
IsPlayerInRangeOfPoint(p7.0x8y8z8)) {
                             new 
Float:_distPlayer;
                             
_distPlayer GetPlayerDistanceFromPoint(px8y8z8);
                             if(
_distPlayer _distMax) {
                                  
_closePlayer p;
                             }
                        }
                    }
                    
GivePlayerMoneyA(_closerPlayer150); 
Reply


Messages In This Thread
Give money for player - by Foxer123456 - 06.03.2018, 12:35
Re: Give money for player - by AroseKhanNiazi - 06.03.2018, 13:08
Re: Give money for player - by Foxer123456 - 06.03.2018, 13:29
Re: Give money for player - by Private200 - 06.03.2018, 13:32
Re: Give money for player - by AroseKhanNiazi - 06.03.2018, 13:34
Re: Give money for player - by Private200 - 06.03.2018, 13:39
Re: Give money for player - by AroseKhanNiazi - 06.03.2018, 13:41

Forum Jump:


Users browsing this thread: 1 Guest(s)