The command WORKS but if you're not an admin or in a vehicle as it says, it returns the unsuccessful command performed message.
PHP Code:
CMD:parkcar(playerid, params[])
{
new
string[128], Float:Pos[4], currentcar = GetPlayerVehicleID(playerid), vehid = IsFactionVehicle(currentcar), file = FactionCarFileID(vehid);
if(PlayerData[playerid][AdminLevel] < 4)
SendClientMessage(playerid, GREY, "You are not authorized to use this command.");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
SendClientMessage(playerid, ADM, "ERROR:{FFFFFF} You're not in a vehicle to park.");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetVehicleZAngle(currentcar, Pos[3]);
format(string, sizeof(string), "FactionVehicles/Vehicle_%d.ini", file);
if(fexist(string))
{
dini_FloatSet(string, "vehiclePosX", Pos[0]);
dini_FloatSet(string, "vehiclePosY", Pos[1]);
dini_FloatSet(string, "vehiclePosZ", Pos[2]);
dini_FloatSet(string, "vehiclePosR", Pos[3]);
SetVehicleToRespawn(FacVehicleData[file][vehicleIG]);
PutPlayerInVehicle(playerid, FacVehicleData[file][vehicleIG], 0);
printf("DEBUG: Faction vehicle ID %d (file ID %d) park pos was changed by %s.", FacVehicleData[file][vehicleIG], file, GetName(playerid));
SendClientMessage(playerid, ADM, "SERVER:{FFFFFF} This vehicles' park position was changed.");
}
return 1;
}