18.11.2013, 06:27
Is here anything wrong?
I don't know, is this cause a bug, but maybe.
Bug is: When i buy vehicle from store or from other player, then GM sets vehicle a owner who bought the car.
Now, GM sets all cars which is on the server, to him and no one else couldn't drive vehicles. One player owns all the server vehicles.
I don't know, is this cause a bug, but maybe.
Bug is: When i buy vehicle from store or from other player, then GM sets vehicle a owner who bought the car.
Now, GM sets all cars which is on the server, to him and no one else couldn't drive vehicles. One player owns all the server vehicles.
pawn Код:
case 0:
{
if(Player[playerid][Money] >= 6000)
{
new modelid = 542;
new Query[512], NewOwnedCar;
TotalVehiclesCreated ++;
format(Query, sizeof(Query), "INSERT INTO `OwnedVehicles` (`OwnedVehicleID`, `OwnedVehicleModel`, `OwnedVehicleColor1`, `OwnedVehicleColor2`, `OwnedVehiclePrice`, `OwnedVehicleOwner`, `OwnedVehicleX`, `OwnedVehicleY`, `OwnedVehicleZ`, `OwnedVehicleA`, `OwnedVehiclePlate`, `OwnedVehiclePaintJob`, `OwnedVehicleLock`) VALUES (%d, %d, 0, 0, 15000, '%s', 646.4609,-500.7132,15.9955,357.9123, '001', 0, 0)", TotalVehiclesCreated, modelid, pName(playerid));
mysql_query(Query);
Player[playerid][Money] -= 6000;
NewOwnedCar = CreateVehicle(modelid, 1350.2736,352.1997, 19.7885, 65.0837, 0, 0, -1);
SetVehicleNumberPlate(NewOwnedCar, Vehicles[NewOwnedCar][VehiclePlate]);
TotalPlayerVehicles[playerid] += 1;
TogglePlayerControllable(playerid, 1);
OwnedCar(NewOwnedCar) = TotalVehiclesCreated;
TotalPlayerVehicles[playerid] += 1;
SendClientMessage(playerid, YELLOW, "Хnnitlused! Sa ostsid omale auto. Sхiduki abi -> '/help vehicle'.");
GameTextForPlayer(playerid, "~b~Vehicle Acquired!", 3000, 5);
format(Vehicles[OwnedCar(NewOwnedCar)][VehicleOwner], 24, "%s", pName(playerid));
Vehicles[OwnedCar(NewOwnedCar)][vPosX] = 1350.2736;
Vehicles[OwnedCar(NewOwnedCar)][vPosY] = 352.1997;
Vehicles[OwnedCar(NewOwnedCar)][vPosZ] = 19.7885;
Vehicles[OwnedCar(NewOwnedCar)][vPosA] = 65.0837;
if(Player[playerid][CarKey1] == -1)
{
Player[playerid][CarKey1] = TotalVehiclesCreated;
}
else if(Player[playerid][CarKey2] == -1)
{
Player[playerid][CarKey2] = TotalVehiclesCreated;
}
else if(Player[playerid][CarKey3] == -1)
{
Player[playerid][CarKey3] = TotalVehiclesCreated;
}
}
}