Does anyone has a copy of this file for this map?
Server address: server.convoytrucking.net
Get SA-MP 0.3.7 here: Click Here to download SA-MP 0.3.7
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menupublic TollGate_Open(){
for(new i=GetMaxPlayers(); i > -1; i--)
{
for(new a; a<sizeof(GatePos); a++)
{
//If Player is in range of toll gate AND if open is false
if(IsPlayerInRangeOfPoint(i, 6, GatePos[a][0],GatePos[a][1],GatePos[a][2]) && GetPlayerVehicleSeat(i) == 0)
{
if(TollPaid[i][a] == 0)
{
TollPaid[i][a] = 1;
MoveObject(Gate[a], GatePos[a][0], GatePos[a][1], GatePos[a][2]+0.1, 0.15, GatePos[a][3], 0.0, GatePos[a][5]);
GivePlayerMoney(i,-20);
GameTextForPlayer(i,"$20\nToll Paid",3000,4);
}
}
else
{
//If already paid then close the gate
if(TollPaid[i][a] == 1){
MoveObject(Gate[a], GatePos[a][0], GatePos[a][1], GatePos[a][2]-0.01, 0.15, GatePos[a][3], GatePos[a][4], GatePos[a][5]);
TollPaid[i][a] = 0;
}
}
}
}
return 1;
}
Quote from: Zeke on May 09, 2020, 13:30
Try getting the range of the player before closing the gate
something like this but not exactly.
if(!IsPlayerInRangeOfPoint(i, 8.0, GatePos[a][3], GatePos[a][4], GatePos[a][5]))
{
if(!open[i])
{
MoveObject(Gate[a], GatePos[a][0],GatePos[a][1],GatePos[a][2], 5.00, GatePos[a][3], GatePos[a][4], GatePos[a][5]);
open[i] = false;
}
}
Quote from: Sjomp on May 09, 2020, 08:54
Changeif(!open[i]){
toelse if(open[i]){
I think open should be true here right?