Paint & Spray BIZ
#1

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?
Reply
#2

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 .
Reply
#3

Thats a good idea i try it thankyou for help i hope there are much more ideas.
Reply
#4

You need SetTimeEx with maryos code and make 'playeralreadythere' an array
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)