Pickup
#1

Greedings,i have got pickup problem for example...
if(IsPlayerInRangeOfPoint(playerid,2.0,x,y,z))
{
SendClientMessage(playerid,-1,"You are in the pickup");
}
And the message "You are in the pickup" showed a lot of time i want to this...The message shows only one time when player pick pickup.
Reply
#2

Try this
PHP код:
if(IsPlayerInRangeOfPoint(playerid,2.0,x,y,z))
{
SendClientMessage(playerid,-1,"You are in the pickup");
return 
1;

Reply
#3

If the player is going again and again near the pick up then it will show multiple times.
Reply
#4

Quote:
Originally Posted by Bingo
Посмотреть сообщение
If the player is going again and again near the pick up then it will show multiple times.
Exactly.

Hi O.P, Either user 1fret's method or use this method..

PHP код:
if(IsPlayerInRangeOfPoint(playerid2.0XYZ)) return SendClientMessage(playerid,-1You are at the pickup!"); 
Reply
#5

Quote:
Originally Posted by Bingo
Посмотреть сообщение
If the player is going again and again near the pick up then it will show multiple times.
Yes thats my problem.
And it doesnt work still showing me multiple times....Please help meeeeeee.
Reply
#6

Quote:
Originally Posted by IchNar
Посмотреть сообщение
Yes thats my problem.
And it doesnt work still showing me multiple times....Please help meeeeeee.
Have you used my method and 1fret's method?
Reply
#7

Код:
#include <a_samp>

enum YOUR_PLAYER_ENUM
{
        OnPickup
}
new Guy[MAX_PLAYERS][YOUR_PLAYER_ENUM];

forward YourFunctionName(playerid);
public YourFunctionName(playerid)
{
        if(IsPlayerInRangeOfPoint(playerid,2.0,0.0,0.0,0.0))
                {
                Guy[playerid][OnPickup]++; 
                if(Guy[playerid][OnPickup] == 1 && IsPlayerInRangeOfPoint(playerid,2.0,0.0,0.0,0.0))
                        {
                                        SendClientMessage(playerid,-1,"You are on the pickup");
                        }        
                if(!IsPlayerInRangeOfPoint(playerid,2.0,0.0,0.0,0.0))Guy[playerid][OnPickup] = 0;
                }  
        return 1;
}
Should go
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)