27.11.2012, 12:58
Vehicles that are spawned through vehicleDB.txt file work fine, but when I destroy a locked vehicle that I spawn with a vehicle spawn command in-game the playerDB[user][pcar]=-1; doesn't work and it is shows that I still have a car.
Код:
if(vehicleDB[vehicleid][locked]) // If the car is locked
{
new name[MAX_PLAYER_NAME];
new user = vehicleDB[vehicleid][lastuser];
GetPlayerName(user,name,sizeof(name));
if(!IsPlayerConnected(user)) return 1;
if(strcmp(name,vehicleDB[vehicleid][owner_name],true)) return 1;
playerDB[user][pcar]=-1; // Sets that player no longer has a car
return 1;
}
Код:
new vehicleid = CreateVehicle(model, x, y, z, rotation, color, color, respawntime); playerDB[playerid][pcar]=vehicleid; vehicleDB[vehicleid][locked]=true;

