Pickup - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pickup (
/showthread.php?tid=640552)
Pickup -
IchNar - 04.09.2017
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.
Re: Pickup -
1fret - 04.09.2017
Try this
PHP код:
if(IsPlayerInRangeOfPoint(playerid,2.0,x,y,z))
{
SendClientMessage(playerid,-1,"You are in the pickup");
return 1;
}
Re: Pickup -
Bingo - 04.09.2017
If the player is going again and again near the pick up then it will show multiple times.
Re: Pickup -
JasonRiggs - 04.09.2017
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(playerid, 2.0, X, Y, Z)) return SendClientMessage(playerid,-1, You are at the pickup!");
Re: Pickup -
IchNar - 04.09.2017
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.
Re: Pickup -
JasonRiggs - 04.09.2017
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?
Re: Pickup -
kAn3 - 04.09.2017
Код:
#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