Paint & Spray BIZ - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Paint & Spray BIZ (
/showthread.php?tid=90472)
Paint & Spray BIZ -
Master_FM - 08.08.2009
Hi i want to make a Paintnspray biz
If the player drive into paint spray they 100$ get to the PNS BIZ
else if(PlayerToPoint(2.0,i,1040.7855,-1021.7409,31.8312) || PlayerToPoint(2.0,i,-2722.4807,217.0514,4.1886))
{
if(IsPlayerInAnyVehicle(i))
{
SBizzInfo[5][sbTill] += 500;
ExtortionSBiz(5, 500);
SBizzInfo[5][sbProducts]--;
return 1;
}
}
But the most time they get much more than 100$ ... Anyone have a idea how to do that?
Re: Paint & Spray BIZ -
Dj_maryo1993 - 08.08.2009
I guess that because the script it's executed more than once , coz it check's the position more than once.
Try to make another case , like
On top of the script
Код:
new playeralreadythere = 0
Код:
new forward timeforremoneybiz
pawn Код:
else if(PlayerToPoint(2.0,i,1040.7855,-1021.7409,31.8312) || PlayerToPoint(2.0,i,-2722.4807,217.0514,4.1886))
{
If(playeralreadythere == 0)
{
if(IsPlayerInAnyVehicle(i))
{
SBizzInfo[5][sbTill] += 500;
ExtortionSBiz(5, 500);
SBizzInfo[5][sbProducts]--;
playeralreadythere = 1;
SetTimer("timeforremoneybiz", 5000, 0);
return 1;
}
}
}
On the bottom of the script
pawn Код:
public timeforremoneybiz
{
playeralreadythere = 0;
}
PS : I didn't tested this .
Re: Paint & Spray BIZ -
Master_FM - 08.08.2009
Thats a good idea i try it thankyou for help i hope there are much more ideas.
Re: Paint & Spray BIZ -
dice7 - 08.08.2009
You need SetTimeEx with maryos code and make 'playeralreadythere' an array