22.04.2014, 17:23
I'm rewriting a script I made so long ago with my newer knowledge of SAMP and Pawn scripting. I've got it almost completely working except for one small bit of code.
The issue: When other players create a car, all works fine. When I create a car (as id 0), I get the output that there's nobody in the car, when there actually is someone in the car.
The issue: When other players create a car, all works fine. When I create a car (as id 0), I get the output that there's nobody in the car, when there actually is someone in the car.
pawn Код:
if (BCDisabled[playerid] == 0)
{
for (new i=0; i<MAX_PLAYERS;i++)
{
for (new j=0;j<MAX_VEHICLES;j++)
{
if (IsPlayerInVehicle(i,BC[j]))
{
SendClientMessage(j, Yellow , "Bait-Car Disabled.");
SendClientMessage(i, Yellow , "You are locked in the Bait-Car.");
SetVehicleParamsEx(BC[j], 0, 0, 0, 0, 0, 0, 0);
BCDisabled[j] = 1;
return 1;
}
else return SendClientMessage(j, Yellow , "Nobody in Bait-Car.");
}
}
}
else
{
SendClientMessage(playerid, Yellow , "Bait-Car Enabled.");
SetVehicleParamsEx(BC[playerid], 1, 0, 0, 0, 0, 0, 0);
BCDisabled[playerid] = 0;
return 1;
}